React 18 support in React Native #40695
Labels
Mobile App - i.e. Android or iOS
Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
[Priority] High
Used to indicate top priority items that need quick attention
Description
React 18 is not supported yet by React Native, however, the web version might use it soon. The purpose of this issue is mainly to collect information around this topic and open discussion about the better way to proceed.
Option 1 - Use React 18 in current RN version
The new React version comes with a React 17 mode in case the new concurrent rendered is not used (reference). This feature might allow us to use React 18 with the current React Native version.
In any case, the new APIs won't be available so we'd need to provide a mechanism to identify if these APIs are used in the code shared between platforms. This most likely could be achieved using unit tests and mocking the new APIs so they raise exceptions when they are used.
As a first step to validate this approach, we would need to upgrade React to version 18, and perform a test on the app to identify potential breakages.
Option 2 - Have two React versions
The idea would be to support both React versions 17 and 18 until React Native provides support for React 18. Therefore, each platform will use a different React version:
In order to accomplish this approach, we would need to explore how to have both versions in the Gutenberg repository.
The text was updated successfully, but these errors were encountered: