Act 18 formally introduces the progressive upgrade strategy for concurrent patterns/features

React18 focuses on solving compatibility and how to do migration since Concurrent Mode.

Core team members were scared to death every day on Github [XXX isnotcm-safe], making the whole community secretly worried about whether React would directly break change for CM in the future

Then all code incompatible with CM must be migrated to use CM(‘all-or-nothing’upgrade strategy)

This release finally swept away everyone’s concerns. The introduction of concurrency will be opt-in. Otherwise, there will be no breaking changes

1. The React team has made a lot of improvements to the compatibility of ‘Concurrency opt-in’roots – if we don’t use CM, it’s likely that just works will never have CM again, only Concurrent Features.

Legacy root- One of the changes to the system is so that your React colleagues can run on different versions

What was actually done in 18 was to introduce a new Root API, reactdom.createroot, to distinguish it from the old Reactdom.render API

You can split the entire React tree into different roots. Legacy Roots using the old API will run in Legacy Mode (equivalent to running on 17). Roots using the new API will run under the ‘Concurrency opt-in’ roots

React 18 other new features

1. The more aggressive [automatic batching]——React 17 only batchin event callbacks,React 18 does as much batching on setState from any source as possible

2. The new useDeferredValue API—— essentially allows you to mark parts of your UI as low [update priority]

Facebook.com is completely rewritten with React and uses Hermes to do SSP to optimize the first screen rendering, so SSR optimization has become a priority for the React team…… But one of the problems with traditional SSR is that the delay for full rendering is too high, whereas CM+Suspence could do that by applying a fragment and then do streaming SSR based on that.

4.StrictMode added double-effect after double-render —— it can be seen that, with the gradual landing of CM, its [bottom ability] side finally began to gradually significant, more and more upper applications will be released (Brian mentioned Offscreen API and RN pre-render)