NativeBase: Cannot install into existing React Native 0.69.x + React v18 project start from React Native seed

Description

I try to install into existing RN project start from React Native seed

CodeSandbox/Snack link

N/A

Steps to reproduce

Hi, I try to install into existing RN project start from React Native seed.

    "react": "18.0.0",
    "react-native": "0.69.4",

I’ve this compatibility error:

image

NativeBase Version

3.4.13

Platform

  • Android
  • CRA
  • Expo
  • iOS
  • Next

Other Platform

No response

Additional Information

No response

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 12
  • Comments: 24

Most upvoted comments

Might help someone but I just installed react-dom to the expected version prior to install to avoid it trying to install 18.2.0

npm i react-dom@18.0.0 --save --save-exact

Edited to save exact version

Hi all, use --legacy-peer-deps

I am also getting this exact same issue. The same steps to recreate it as well.

Have you any news?

No news, also figured out that if you npm -i --force it will break everything.

No. Don’t use the force option.

https://nativebase.io/roadmap image

Looks like the latest expo SDK are not officially support yet.

Stackoverflow

@biapar @leighton-tidwell

  1. Add overrides react v18.
  "overrides": {
    "react": "18.0.0"
  },
  1. Then run

npm i native-base

Works for me. PS: When i use --force flag to install native-base the emulator crashes after app refresh many times without edit the code.

image

getting same error when i do npm i native-base on new react native 0.70 but i can install with flag --legacy-peer-deps but I wonder if native base is fully compatible with react 18 and react native 0.70 and I don’t get any issues in future so I dont have to revert back to older version of react native and react