Summary of React 19 Changes Affecting Real-World Practice
Since the official release of React 19, I've organized my thoughts based on what I felt while applying it to company projects.
1. use() hook - You can now directly consume Promises or Context during rendering. When used with Suspense, the data fetching structure becomes noticeably simpler.
2. ref can be passed as a prop - You no longer need forwardRef. It reduces a bit of code.
3. Server Components stabilization - Since they can now be used outside Next.js, it's worth considering using pure server components without routing.
One thing to note: some libraries still don't support React 19, so check your dependencies before migrating.
7 answers
Oh, I didn't know that. It's nice that ref can be passed as props.
The use() hook and Suspense combo is really sweet. I tried applying it myself, and the data fetching code got a lot shorter.
Well, Server Components still have library compatibility as a stumbling block. Isn't it premature unless it's Next.js?
For real, frontend is getting easier and easier.
We tried migrating, but ended up rolling back because of errors in some libraries. T_T Checking versions is really important.
The use() hook throws a Promise during rendering, so if you don't set up the Suspense boundary correctly, it can lead to infinite loops or loading delays. It only works properly when paired with an error boundary.
Thanks for the good summary. I'll have to look into how ref props work later.