Running in "Unable to read property" ReactCurrentOwner "from undefined" after installing packages

In ReactNative, the following error appears when starting the application:

Cannot read property 'ReactCurrentOwner' of undefined

This usually happens after installing a new package or switching branches in my project with different package sets installed.

I can resolve it by running react-native-git-upgrade , but this does not seem like a real solution.

Any ideas what might cause this error and how to avoid it?

+5
source share
1 answer

had the same problem, and, as you say, this is a version compatibility issue in reaction and response. It will also affect the expo if you use it.

React + React-native must use certain versions that work with each other.

Github's org community response provides a table that helped me install the correct versions. Here are some examples from this document:

  • react-native@0.41.x and 0.42.x need a reaction @ 15.4.x

  • react-native@0.43.x and 0.44.x need reaction @ 16.0.0-alpha.6

  • native reaction above 0.44-0.48 requires reaction @ 16.0.0-alpha .12

Please note that I did npm install --save react@ <correct version>

Then rm -rf node_modules && npm install

And finally: npm start --reset-cache

My app starts up again!

+3
source

Source: https://habr.com/ru/post/1269143/


All Articles