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

fix(next-international): changeLocale with subsequent navigations #140

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

QuiiBz
Copy link
Owner

@QuiiBz QuiiBz commented Aug 30, 2023

Relates to #138

The Router Cache of Next.js caches by route segments and causes issues when changing locale and navigating to already-viewed pages. Turns out we can simply call router.refresh() to invalidate the Router Cache and get the correct data for every page: https://nextjs.org/docs/app/building-your-application/caching#invalidation-1

@vercel
Copy link

vercel bot commented Aug 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
next-international ❌ Failed (Inspect) Aug 30, 2023 6:31am

@QuiiBz QuiiBz merged commit 3bb6dce into main Aug 30, 2023
4 checks passed
@QuiiBz QuiiBz deleted the fix/change-locale-subsequent-navs branch August 30, 2023 06:32
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

Successfully merging this pull request may close these issues.

1 participant