News for hackers. Stuff that matters.
Re:React 19 by nailer on Thursday December 05, 2024 @02:57PM (#42332004)
I'd hoped this release would have added a compiler and drastically simplified the syntax to something close to a modern framework. I know React is eventually going to do that, but it feels like React has been drowning in overly complex DX for at least the last 5 years.
Re:React 19 by acemarke on Thursday December 05, 2024 @03:02PM (#42332079)
The React Compiler is currently in beta:

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-...