3 ms·
The React Compiler is currently in beta: https://react.dev/blog/2024/10/21/react-compiler-beta-release https://react.dev/blog/2024/10/21/react-compiler-beta-re
by acemarke 2y ago
The React Compiler is currently in beta:
https://react.dev/blog/2024/10/21/react-compiler-beta-release https://react.dev/blog/2024/10/21/react-compiler-beta-releas...
That said, it doesn't change the APIs included in React itself, or the overall usage patterns. Ultimately it rewrites your component code to add a lot of conditional comparisons to see if props or state values changed, and uses that to trigger React's existing rendering optimization behaviors.
Long-term, I expect that the React Compiler _will_ result in a significant change in the DX for using React. React's default behavior has always been "re-render recursively regardless of props changes" [0], but people often assume it's "only re-render the child if the props changed". React Compiler actually makes flips React's default behavior to make that a reality.
[0] https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-mostly-complete-guide-to-react-rendering-behavior/#standard-render-behavior https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-...