Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51856 Enables the `enableEagerAlternateStateNodeCleanup` feature flag in the open source React Native renderers that are currently targeting React 19.1, by manually patching them in the React Native repository. This feature flag has been found to significantly improve memory management of parent alternate fibers in persistent modes (i.e. Fabric), and we want this to be available to open source users of React Native before the next scheduled public version release of React. For more details about the fix, see: https://github.com/facebook/react/pull/33161 Changelog: [General][Changed] - Reduces memory usage, by improving memory management of parent alternate fibers. (Previously, a parent fiber might retain memory associated with shadow nodes from a previous commit.) Reviewed By: rickhanlonii Differential Revision: D76073900 fbshipit-source-id: 6779ea0862d4a1e25354b12ef3d1363dc12d26cc
React & React Native Versions
This page describes how React and React Native versions interact each other. The version alignment between the two frameworks relies on two synchronization points:
- The versions in the
package.jsonof the new app template. For example for React Native 0.68.1 the versions are aligned as follows:
"dependencies": {
"react": "17.0.2",
"react-native": "0.68.1"
},
- The React renderers shipped with React Native inside this folder, the ./Libraries/Renderer folder, of React Native.
This practically means that you can't bump the version of React in your package.json to a later version,
as you will still be using the older renderer from the folder mentioned above. Bumping the react version in your package.json will lead to unexpected behaviors.
For the sake of React 18, the first version of React Native compatible with React 18 is 0.69.0. Users on React Native 0.68.0 and previous versions won't be able to use React 18.
If you use the react-native upgrade command or the React Native Upgrade Helper, you'll bump to the correct React version once you upgrade React Native.