You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shallow rendering depends on React internals and can block you from future upgrades. We recommend migrating your tests to [@testing-library/react](https://testing-library.com/docs/react-testing-library/intro/) or [@testing-library/react-native](https://callstack.github.io/react-native-testing-library/docs/getting-started).
356
+
Shallow rendering depends on React internals and can block you from future upgrades. We recommend migrating your tests to [@testing-library/react](https://testing-library.com/docs/react-testing-library/intro/) or [@testing-library/react-native](https://testing-library.com/docs/react-native-testing-library/intro).
357
357
358
358
</Note>
359
359
@@ -524,7 +524,7 @@ We are deprecating `react-test-renderer` because it implements its own renderer
524
524
525
525
The test renderer was created before there were more viable testing strategies available like [React Testing Library](https://testing-library.com), and we now recommend using a modern testing library instead.
526
526
527
-
In React 19, `react-test-renderer` logs a deprecation warning, and has switched to concurrent rendering. We recommend migrating your tests to [@testing-library/react](https://testing-library.com/docs/react-testing-library/intro/) or [@testing-library/react-native](https://callstack.github.io/react-native-testing-library/docs/getting-started) for a modern and well supported testing experience.
527
+
In React 19, `react-test-renderer` logs a deprecation warning, and has switched to concurrent rendering. We recommend migrating your tests to [@testing-library/react](https://testing-library.com/docs/react-testing-library/intro/) or [@testing-library/react-native](https://testing-library.com/docs/react-native-testing-library/intro) for a modern and well supported testing experience.
528
528
529
529
## Notable changes {/*notable-changes*/}
530
530
@@ -536,6 +536,24 @@ When double rendering in Strict Mode in development, `useMemo` and `useCallback`
536
536
537
537
As with all Strict Mode behaviors, these features are designed to proactively surface bugs in your components during development so you can fix them before they are shipped to production. For example, during development, Strict Mode will double-invoke ref callback functions on initial mount, to simulate what happens when a mounted component is replaced by a Suspense fallback.
538
538
539
+
### Improvements to Suspense {/*improvements-to-suspense*/}
540
+
541
+
In React 19, when a component suspends, React will immediately commit the fallback of the nearest Suspense boundary without waiting for the entire sibling tree to render. After the fallback commits, React schedules another render for the suspended siblings to "pre-warm" lazy requests in the rest of the tree:
542
+
543
+
<Diagramname="prerender"height={162}width={1270}alt="Diagram showing a tree of three components, one parent labeled Accordion and two children labeled Panel. Both Panel components contain isActive with value false.">
544
+
545
+
Previously, when a component suspended, the suspended siblings were rendered and then the fallback was committed.
546
+
547
+
</Diagram>
548
+
549
+
<Diagramname="prewarm"height={162}width={1270}alt="The same diagram as the previous, with the isActive of the first child Panel component highlighted indicating a click with the isActive value set to true. The second Panel component still contains value false." >
550
+
551
+
In React 19, when a component suspends, the fallback is committed and then the suspended siblings are rendered.
552
+
553
+
</Diagram>
554
+
555
+
This change means Suspense fallbacks display faster, while still warming lazy requests in the suspended tree.
556
+
539
557
### UMD builds removed {/*umd-builds-removed*/}
540
558
541
559
UMD was widely used in the past as a convenient way to load React without a build step. Now, there are modern alternatives for loading modules as scripts in HTML documents. Starting with React 19, React will no longer produce UMD builds to reduce the complexity of its testing and release process.
0 commit comments