react
react copied to clipboard
React is null in @formio/react src/components
I am trying to add some changes to @formio/react , but when I run the project with my custom cloned @formio/react , the page crashes and I get these errors :
Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
and :
Uncaught TypeError: Cannot read properties of null (reading 'useRef')
So I checked out my source code and I realized that the React in import React from 'react'; is null !
No auto complete also works when I type React.
File extension is .jsx
So I simply say that React is not recognized in my jsx files !
React is going to be a peer dependency of the library, so I wonder if your dependencies are just not being installed here?