I'm trying to implement React Native into an existing Android application. I follow the steps in the official documentation and I have ended with the following error when I compile the app (Although I receive an error the build is successful).
On my phone:
In Android Studio emulator:
Has someone faced the same issue?
Is the official React Native docs wrong?
Unless you are using the React context API yourself, this is likely to be related to a mismatch between your React version and the version of some other dependency like react-dom
Please check in your package.json if react-dom and react versions match.
You can upgrade the react version to solve the problem
yarn upgrade react react-dom
Also see these similar questions:
"React.createContext is not a function" - but I am not using it
_react.default.createContext is not a function when using react-redux