Skip to content

Switching locale flashes color theme - using next-themes #1867

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

Open
3 tasks done
benqSzaw opened this issue Apr 25, 2025 · 1 comment
Open
3 tasks done

Switching locale flashes color theme - using next-themes #1867

benqSzaw opened this issue Apr 25, 2025 · 1 comment
Labels
bug Something isn't working unconfirmed Needs triage.

Comments

@benqSzaw
Copy link

Description

Changing language through link component with app using next-themes flashes other theme.

Verifications

Mandatory reproduction URL

https://github.com/benqSzaw/next-intl-bug-repro-app-router

Reproduction description

Steps to reproduce:

  1. Open reproduction
  2. Click on theme switch to get dark theme
  3. Click on lang switch
  4. See error: page flashes with white

Expected behaviour

Not flashing

@benqSzaw benqSzaw added bug Something isn't working unconfirmed Needs triage. labels Apr 25, 2025
@amannn
Copy link
Owner

amannn commented Apr 27, 2025

It seems like next-themes reads your theme preference from local storage and only sets it once the script runs on the page.

Image

I'm not aware of anything that next-intl could do to help here, sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed Needs triage.
Projects
None yet
Development

No branches or pull requests

2 participants