"React.createContext is not a function" - but I am not using it

Try upgrading React to React to 16.4.1


In your package react and react-dom are not having the same version which is why you get the error. [email protected] will want to have access to React.createContext but [email protected] won't have it.

In order make it work run the following command:

yarn upgrade [email protected]

Or if you are using NPM:

npm install [email protected]

Adding @emotion/react resulted in a similar error TypeError: React.createContext is not a function. The error disappeared after I removed @emotion/react and downgraded @emotion/styled from 11 to 10.