Skip to content

TypeError: Cannot read properties of null (reading 'useContext') #5937

Answered by Devmond
Devmond asked this question in Q&A
Discussion options

You must be logged in to vote

I can confirm that the issue is due to duplicate inclusions of react and react-dom in the bundle and the web page.

I went through the exercise of bundling with webpack and following the suggestions here , ie by adding this to the webpack config the issue went away:

externals: {
    'react': 'React',
    'react-dom': 'ReactDOM'
}

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@Devmond
Comment options

@Devmond
Comment options

@snowystinger
Comment options

@Devmond
Comment options

Answer selected by snowystinger
@snowystinger
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants