mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
4ce22ebcfeb264b6b20e5a5b6f7fc16585a0f907
Adds a new feature flag which tells the compiler to assume that hooks follow the Rules of React. Specifically, the idea that since any hook could be wrapped in a giant `useMemo()` call, all arguments to hooks have to be treated as if they're owned by React — and therefore become immutable — and that the return value of the hook is immutable. Our default is to assume that hooks break the rules, but in practice nearly every component follows them.
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%