_react.default.createContext is not a function when using react-redux
Got the issue fixed by updating the react and react-dom
npm update react react-dom
And ofcourse closing the server and restarting by npm start again.
Try installing with this version: yarn add [email protected]
Whenever you git pull or use someone's else code, try updating your package to the latest version using:
npm update
always check the React/React-dom versions, especially when you have imported project while following any online course !!
Also, if you don't want to update all packages by npm update just do :
npm i react@latest react-dom@latest
I Hope this helps !!
react-redux v6.0.0
uses the new context api provided by React and in order for it work, either you need to downgrade react-redux
to v5.x.x
or upgrade react
and react-dom
to v16.4
or above
If you are using yarn, you can run
yarn upgrade react react-dom
else with npm you can run
npm update react react-dom
You could also change the versions manually in package.json and run yarn install
or npm install