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

ReferenceError: useEffect is not defined #1787

Closed
mbaumbach opened this issue Feb 12, 2021 · 4 comments
Closed

ReferenceError: useEffect is not defined #1787

mbaumbach opened this issue Feb 12, 2021 · 4 comments
Labels

Comments

@mbaumbach
Copy link

mbaumbach commented Feb 12, 2021

Describe the bug
Runtime error of ReferenceError: useEffect is not defined in node_modules/react-query/es/devtools/useLocalStorage.js:17

To Reproduce
Steps to reproduce the behavior:

  1. Install 3.9.0
  2. Have the devtools component in your hierarchy
  3. Open your app in the browser
  4. See error

Expected behavior
No errors.

Desktop (please complete the following information):

  • OS: All
  • Browser: All
  • Version: All

Additional context
Seems to be due to the change in #1727

@mbaumbach
Copy link
Author

I suspect the fix is to simply use React.useEffect. I'm a little surprised the CI build and tests passed. That may be a separate issue to investigate.

@mbaumbach
Copy link
Author

Somewhat related, I think that useEffect might be slightly incorrect since the key isn't in the dependency array too. Perhaps it should be modeled after the one here: https://usehooks.com/useLocalStorage/

@mrlubos
Copy link

mrlubos commented Feb 12, 2021

+1

@tannerlinsley
Copy link
Collaborator

🎉 This issue has been resolved in version 3.9.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

No branches or pull requests

3 participants