Invalid hook call. Hooks can only be called inside of the body of a function component.
Aagam41 opened this issue · comments
Describe the bug
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:
- You might have mismatching versions of React and the renderer (such as React DOM)
- You might be breaking the Rules of Hooks
- You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
To Reproduce
Steps to reproduce the behavior:
- ReactJs 18.2.0, React Dom 18.2.0
- Produce the minimal setup of the treeview
Expected behavior
Hooks should be called inside FUNCTIONAL COMPONENTS
Screenshots
Issue is on line number 35, where useEffect is called inside useMemo.