Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React 18 support in React Native #40695

Closed
fluiddot opened this issue Apr 28, 2022 · 3 comments
Closed

React 18 support in React Native #40695

fluiddot opened this issue Apr 28, 2022 · 3 comments
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
Projects

Comments

@fluiddot
Copy link
Contributor

fluiddot commented Apr 28, 2022

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:

  • Web version: React 18
  • Native version: React 17

In order to accomplish this approach, we would need to explore how to have both versions in the Gutenberg repository.

@fluiddot fluiddot added the Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) label Apr 28, 2022
@fluiddot fluiddot added this to Triage in Mobile Apps via automation May 4, 2022
@fluiddot fluiddot added the [Priority] High Used to indicate top priority items that need quick attention label Jul 11, 2022
@fluiddot
Copy link
Contributor Author

fluiddot commented Jul 11, 2022

This issue will be addressed when React Native version is upgraded to 0.68 (reference).

@fluiddot fluiddot moved this from Triage to To do in Mobile Apps Jul 11, 2022
@geriux
Copy link
Member

geriux commented Aug 22, 2022

FYI we are currently working on the React Native upgrade that adds support for React 18. We will need to coordinate with the web team to align with these changes.

@geriux geriux linked a pull request Aug 22, 2022 that will close this issue
@fluiddot
Copy link
Contributor Author

Closing this issue as React 18 support was incorporated in this PR.

Mobile Apps automation moved this from To do to Done Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
Mobile Apps
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants