The React team announced earlier this week that the initial preview for React 18 is live, and work has started for the React 18 release. This is an alpha release and not suitable for production but encourages testing and feedback. Now is the time that library authors can try React 18 and provide feedback and direction before its official release. A primary goal is to prepare the ecosystem for a smooth and graduation adoption of React 18 by using existing applications and libraries.
The upgrades provided with React 18 do not require significant code changes! We may need to repeat this and embrace the beauty of the good news. Almost all of the benefits of the upgrade do not require code changes.
React 18 includes out-of-the-box improvements (automatic batching), new APIs ( ), and a new streaming server renderer with built-in support for . React 18 also includes architectural improvements for React server-side rendering (SSR) performance.
Concurrent Rendering (the new opt-in mechanism) and let's React prepare multiple versions of the UI simultaneously. This change is primarily behind the scenes, but it unlocks new possibilities to improve your app's actual and perceived performance.
Since concurrency in React 18 is opt-in, there are no significant out-of-the-box breaking changes to component behavior. You can upgrade to React 18 with minimal or no changes to your application code, with a level of effort compared to a typical major React release. According to the working team at React, many users will be able to upgrade within a single afternoon.
When you switch to the New Root API, you automatically get the new out-of-the-box improvements that come with React 18!
This change is all you need to do to upgrade the client to React 18. If you only use React client-side, you are finished.
The new API helps with webpage responsiveness. The startTransition can not only keep current webpage responsive and able to perform heavy non-blocking UI updates at the same time.
Think of it when a user types in a search box, the input value is immediately updated while the research results may wai t afew milliseconds. The API provides a way to differientation between quick and delayed updates. The delayed udpates is referred to as Transition Updates.
Heavy UI or non-urgent updates we can wrap with startTransition API as:
React 18 offers full support for Suspense; if you remember, React 16 had support but not full support.
Suspense is a functionality set that allows for waiting for data to resolve before a state transition (delayed transitions), reducing UI clashes while data loads (placeholder throttling), and coordinating the appearance of a set of components by streaming them in order (SuspenseList). With React 18, we can break React components into smaller chunks using .
There is no specific release date scheduled, but we should expect something over the next few months.
• Library Alpha: Available June 2021
• Public Beta: June 2021 + a few months
• Release Candidate (RC): Several weeks post Beta Release
• General Availability: Several weeks post RC
The initial preview. Most features are stable, but work is being done to finalizes new APIs and stylesheets.
Once React 18 is feature complete, the React 18 Beta will be released. The Beta version includes all of the breaking changes and new features to the final release. Beta is also a time for a larger community (outside of the library authors) to start trying React 18, provide feedback, and report any remaining issues.
When React 18 is fully feature complete and confident in the stability of the release, it becomes a release candidate.
Then React 18 can release!