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

Next.js suspense triggered twice with next-themes #283

Closed
Sh031224 opened this issue Apr 22, 2024 · 1 comment
Closed

Next.js suspense triggered twice with next-themes #283

Sh031224 opened this issue Apr 22, 2024 · 1 comment

Comments

@Sh031224
Copy link

Sh031224 commented Apr 22, 2024

Problem

When using next-themes with suspense, suspense is triggered twice.

I'm not even using react strictmode.
The problem only occurs when using next-themes.

The same happens in production.

Demo

codesandbox

with next-themes

2024-04-22.5.30.49.mov

without next-themes

2024-04-22.5.31.42.mov

Version

  • react 18.2.0
  • next 14.2.1
  • next-themes 0.3.0
  • @tanstack/react-query 5.28.4
@Sh031224
Copy link
Author

This happened because I was not using ReactQueryStreamedHydration in my React query.

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