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
Updating from 2.1.5 to 2.2.0 causes issue with hooks order in next.js app router #2702
Comments
I encountered the same problem. As I modify other parts of the code (removing useMemo), this issue appears and disappears like a ghost, making it difficult for me to organize a minimal reproducible code. I will try again when I have time. |
|
In my case, I didn't use dynamic but still encountered the problem of hook order, so I suspect this may not be related to dynamic. |
I'm unable to come up with a minimum reproduction, but adding/removing useMemo seems to affect the issue indeed |
I reproduced this bug. https://github.com/uonr/swr-issue-2702-reproduction/blob/master/app/Client.tsx |
The same error occurred when I used useSWRInfinite and dynamic. |
will be tracked in #2849 |
Bug report
Description / Observed Behavior
After updating from 2.1.5 to 2.2.0 I start seeing the following error:
Expected Behavior
Upgrading doesnt change the hooks order
Repro Steps / Code Example
I don't have a minimal repro, but I only see this error on a page where I use the a dynamic nextjs route segment as a variable:
and I have suspense enabled (and only running this client side.
Additional Context
version 2.2.0
suspense enabled
ssr false
The text was updated successfully, but these errors were encountered: