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: Handle changing href for <Link /> correctly when using localePrefix: 'never' #926

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

amannn
Copy link
Owner

@amannn amannn commented Mar 7, 2024

Fixes #918

Copy link

vercel bot commented Mar 7, 2024

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

Name Status Preview Comments Updated (UTC)
next-intl-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 8, 2024 1:39pm
next-intl-example-app-router ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 8, 2024 1:39pm


setLocalizedHref(
localizeHref(href, locale, defaultLocale, pathname ?? undefined)
);
}, [defaultLocale, href, locale, localePrefix, pathname]);
}, [defaultLocale, href, locale, pathname]);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this effect in the first place? Is this outdated and can we remove it?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some notes to #444 (comment), let's continue there …

@amannn amannn marked this pull request as ready for review March 8, 2024 13:38
@amannn amannn changed the title fix: Handle changing href for <Link /> when using localePrefix: 'never' correctly fix: Handle changing href for <Link /> correctly when using localePrefix: 'never' Mar 8, 2024
@amannn amannn merged commit b609dc0 into main Mar 8, 2024
6 checks passed
@amannn amannn deleted the fix/918-update-link-href-localeprefix-never branch March 8, 2024 13:50
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.

Link href doesn't update when search params change when localePrefix is set to never.
1 participant