I run into the following error in ReactNative on app launch:
Cannot read property 'ReactCurrentOwner' of undefined
This usually happens after installing a new package or switching branches on my project with different sets of packages installed.
I'm can resolve it by running react-native-git-upgrade
but this does not seem like a real solution.
Any ideas what can cause this error and how to avoid it?
was having the same issue and as you say, it's a version compatibility problem in react and react-native. Would also affect expo if you're using that.
React + React-native have to use specific versions that work with each other.
The react-community org on Github provides a table that helped me install the correct versions. Here are a few examples from that document:
[email protected] and 0.42.x need [email protected]
[email protected] and 0.44.x need [email protected]
react-native higher than 0.44 to 0.48 need [email protected]
Note that I did npm install --save react@<correct version>
Then rm -rf node_modules && npm install
And lastly: npm start --reset-cache
My app runs again!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With