React Component - Cannot read properties of null (reading 'useState')
I am building a little local dev/testing/documentation environment for some components which are used across different projects and so want to create them as individual npm packages. Everything was working perfectly until I tried to use useState() in one of the components. Add this created the following errors: Invalid hook call. Hooks can only be called inside of the body of a function component. TypeError: Cannot read properties of null (reading 'useState') I feel this is strange and I can't figure out what is causing it. I also tested with other hooks to see if it was just useState that was
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.