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

v0.x: examples using-use-subscription "Invalid hook call" #300

Open
Binlogo opened this issue Aug 13, 2024 · 1 comment
Open

v0.x: examples using-use-subscription "Invalid hook call" #300

Binlogo opened this issue Aug 13, 2024 · 1 comment

Comments

@Binlogo
Copy link

Binlogo commented Aug 13, 2024

To run pnpm examples dev after pnpm i, when checking using-use-subscription, this error encounter.

image

Unhandled Runtime Error
Error: 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
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.

Source
javascript/packages/react-query/dist/index.js (12:23) @ Object.useContext

  10 |   );
  11 |   const helpers = queryCore.createQueryHookHelpers({
> 12 |     useContext: () => react.useContext(Context)
     |                       ^
  13 |   });
  14 |   function useContext2() {
  15 |     const ctx = react.useContext(Context);
Call Stack
Show collapsed frames
@Binlogo Binlogo changed the title v0.x: examples/nextjs using-use-subscription "Invalid hook call" v0.x: examples using-use-subscription "Invalid hook call" Aug 13, 2024
@Binlogo
Copy link
Author

Binlogo commented Aug 13, 2024

The same issues happened in examples/astro as well.

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

No branches or pull requests

1 participant