Upgrading from SDK 45 to 46 and react version 18

Please provide the following:

  1. SDK Version: 46
  2. Platforms(Android/iOS/web/all): all
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

I’m upgrading my managed app from SDK 45 to 46. There is a problem with react 18 version. I mean most of the packages i’m using in the project don’t use react 18 as you said in the blog post of SDK 46:
“… we can’t recommend it yet to any but the most adventurous developers: we don’t support it on Expo module view managers yet, and most libraries in the ecosystem don’t either.”

So what i’ve to do for upgrading to SDK 46 ? i should set in package.json the version od react to 17 and make a npm install ? or i must use SDK 45 until the packages i’m using in the project will update to version 18 of rect ?

Thank you in advance for your support.

I do not think setting react to 17, with SDK 46, will work; you’ll have other dependency tree issues. I’ve been wrestling with this a bit too. I’d suggest sticking to SDK 45, but maybe others will have different opinions/solutions.

Thank you for your reply. For example I’m using the third party package
@react-native-picker/picker that when i’ve run expo-cli upgrade has updated to version 2.4.2. But this version is not supporting react 18 !!

npm ERR! Could not resolve dependency:
npm ERR! peer react@"16 || 17" from @react-native-picker/picker@2.4.2
npm ERR! node_modules/@react-native-picker/picker
npm ERR!   @react-native-picker/picker@"2.4.2" from the root project

I would stick with SDK 45 for now unless someone else has a real solution.

Tip: when you see major package incompatibilities, always search the Issues for the npm package because chances are, someone else has had that same issue. You’ll also see how others may have resolved it.

1 Like

Hello, I recommend to use SDK 45 too

They were not talking about React 18 here, but React Native’s New Architecture and possibly React 18’s concurrent features.

Does it say something about --legacy-peer-deps after that? Did you try it? Or is RN picker really incompatible with React 18?

Yes, it is i will try with that flags

npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

using npm install --legacy-peer-deps i was able to complete the process of installing all the packages for the project. Now i’ve to test the app if any problems.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.