Introducing React 18 #4
Replies: 5 comments 16 replies
-
This is a great first post @rickhanlonii! You've done a great job opening questions and then addressing them in the following section. There is one statement that remains a little thick — to me:
If I'm reading it correctly, this means that I can opt-in to Concurrent rendering for only portions of my application. And that previous iterations of this required root-level StrictMode — but no longer. Is that accurate? If so, is this statement directed at those experimenting with an earlier iterations of Concurrent React? Or is it important information for folks migrating from 17? |
Beta Was this translation helpful? Give feedback.
-
Great post to start with @rickhanlonii 🎉 Can we add a section about concurrent Mode before jumping the API (Concurrent Features)? For those who have already tried the experimental versions will be aware of what it is and how it is going to benefit but for others, it can be helpful if we can add more details about it / link to a doc with more information on the same, maybe we can link experimental concurrent mode as well for those who want to read in-depth? Looks like there is one typo "Once on React 18, you can |
Beta Was this translation helpful? Give feedback.
-
@rickhanlonii one of the features i have experimented with before was time slicing (link) which very promising results. will this still be part of react 18, and can it be enabled? from the tests i've ran previously, i didn't use transitions or deferred values i just switched to createRoot and maybe used react-scheduler to prioritise tasks. |
Beta Was this translation helpful? Give feedback.
-
This is an awesome post @rickhanlonii, thanks for the great summary! I had a question regarding opting into concurrent features on a sub-tree basis. In the case of enabling Streaming SSR with progressive hydration, would the entire tree being rendered get opted into concurrent rendering and therefore need to be StrictMode compliant? |
Beta Was this translation helpful? Give feedback.
-
I'm posting some demos here: #58 (comment) |
Beta Was this translation helpful? Give feedback.
-
Overview
Welcome to the first post in the React 18 workgroup!
This post is intended to provide an overview for the plan for React 18 and serve as a jumping point to other topics in the discussion. At a high level, React 18 includes out-of-the-box improvements to existing features. It is also the first React release to add support for Concurrent Features, which let you improve the user experience in ways that React didn't allow before.
Concurrent Features are opt-in and can be adopted gradually.
Out-of-the-box improvements
React 18 will include out-of-the-box improvements:
Most apps should be able to upgrade to React 18 using the New Root API and immediately see wins from these improvements.
Once on React 18 you can begin to use concurrent features!
Concurrent features
React 18 will be the first React release adding opt-in support for concurrent features such as:
startTransition
: lets you keep the UI responsive during an expensive state transition.useDeferredValue
lets you defer updating the less important parts of the screen.You can start using these features in a small part of your tree without enabling Strict Mode for your entire app.
Note: if you're familiar with concurrent "mode", see: What happened to concurrent "mode".
What about Suspense for data fetching?
The React 18 release includes the foundational work related to
<Suspense>
, but it will likely not include the recommended data fetching solution yet. A complete solution would need to include Server Components and a built-in Cache, and these projects are still in progress. We expect to see them complete during the 18.x timeline, but not necessarily in the 18.0 initial release.For full details about
<Suspense>
in React 18, see this answer.How to upgrade
Upgrading to React 18 will be the same as any React major such as 16 and 17 (by updating to the latest React 18 release with the additional step of switching from
ReactDOM.render
toReactDOM.createRoot
. After upgrading, we recommend testing your app as you normally would with an upgrade to flush out any of the issues surfaced by the out-of-the-box improvements.For specific technical upgrade guides, see:
Once you’ve upgraded to React 18, you can begin using concurrent features:
Related posts
Beta Was this translation helpful? Give feedback.
All reactions