Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React has detected a change in the order of Hooks #283

Open
Schmell opened this issue Jan 2, 2023 · 0 comments
Open

React has detected a change in the order of Hooks #283

Schmell opened this issue Jan 2, 2023 · 0 comments

Comments

@Schmell
Copy link

Schmell commented Jan 2, 2023

I am thinking of maybe trying to migrate to Nextjs. I am sure I am using Nextjs wrong but I get this error when using useDocument or useDocumentData directly on a page route.

`next-dev.js?3515:20 Warning: React has detected a change in the order of Hooks called by MobileNav. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks

Previous render Next render

  1. useReducer useReducer
  2. useCallback useCallback
  3. useCallback useCallback
  4. useCallback useCallback
  5. useMemo useMemo
  6. useEffect useEffect
  7. useReducer useReducer
  8. useCallback useCallback
  9. useCallback useCallback
  10. useCallback useCallback
  11. useMemo useMemo
  12. useRef useRef
  13. useEffect useEffect
  14. useEffect useEffect
  15. useContext useContext
  16. useContext useContext
  17. undefined useContext
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^`

BTW. I wouldn't have created an issue if there was a discussion area
Sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant