microsoft / fluentui

Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
https://react.fluentui.dev
Other
18.6k stars 2.75k forks source link

Investigate `react-compiler` eslint violations #31537

Open spmonahan opened 6 months ago

spmonahan commented 6 months ago

Library

React Components / v9 (@fluentui/react-components)

Describe the feature that you would like added

Codeowners should investigate react-compiler eslint violations as these prevent React Compiler from, potentially, optimizing Fluent UI. Each violation means we're breaking at least one of the Rules of React.

Currently all violations are excepted via 'use no memo', React Compiler's directive to opt out of optimization, as the first phase of this work is simply to enable the compiler. Ideally we'd have no violations but this code has been working to date so it's probably fine, but now that we have tooling to call out issues we should re-evaluate our implementations.

Disabling exhaustive deps lint rule in hooks

Mutating params to a hook

Modifying state returned by a hook

Mutating a variable that React considers immutable

Conditionally calling hooks

Calling hooks from something that is not a functional component

Hook might be a different function on different renders

Have you discussed this feature with our team

@khmakoto

Additional context

See #31457

Validations

Priority

Normal

sopranopillow commented 3 weeks ago

Hi @tudorpopams, we are moving this issue to cxe-prg since it's v9 related. Thanks!