-
-
Notifications
You must be signed in to change notification settings - Fork 236
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
feat!: Require NextIntlClientProvider
for using useLocale
on the client side (preparation for dynamicIO
)
#1541
Merged
+100
−230
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ntProvider`, adjust docs
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
amannn
changed the title
feat!: Don't read a default for
feat!: Don't read a default for Nov 13, 2024
locale
from useParams.locale
on the client sidelocale
from useParams.locale
on the client side, but rely on NextIntlClientProvider
being used
amannn
changed the title
feat!: Don't read a default for
feat!: Require Nov 14, 2024
locale
from useParams.locale
on the client side, but rely on NextIntlClientProvider
being usedNextIntlClientProvider
for using next-intl
in Client Components
amannn
changed the title
feat!: Require
feat!: Require Nov 14, 2024
NextIntlClientProvider
for using next-intl
in Client ComponentsNextIntlClientProvider
when using next-intl
in Client Components
amannn
commented
Nov 14, 2024
amannn
changed the title
feat!: Require
feat!: Don't read a default for Nov 14, 2024
NextIntlClientProvider
when using next-intl
in Client Componentslocale
from useParams.locale
on the client side, but rely on NextIntlClientProvider
being used (preparation for dynamicIO
)
amannn
changed the title
feat!: Don't read a default for
feat!: Don't read a default for Nov 14, 2024
locale
from useParams.locale
on the client side, but rely on NextIntlClientProvider
being used (preparation for dynamicIO
)useLocale
from useParams.locale
on the client side, but rely on NextIntlClientProvider
being used (preparation for dynamicIO
)
# Conflicts: # docs/src/pages/docs/usage/configuration.mdx
amannn
changed the title
feat!: Don't read a default for
feat!: Require Nov 15, 2024
useLocale
from useParams.locale
on the client side, but rely on NextIntlClientProvider
being used (preparation for dynamicIO
)NextIntlClientProvider
for using useLocale
on the client side (preparation for dynamicIO
)
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
tldr; — Do you already have a
NextIntlClientProvider
in your root layout that wraps all Client Components? If yes, you can skip this.Previously,
useParams().locale
was consulted when reading fromuseLocale()
on the client side, allowing to use this API even when noNextIntlClientProvider
ancestor is available.This behavior has now been removed because:
useParams().locale
doesn't apply if you're using an App Router setup without i18n routing.useParams()
might require additional work from the developer in the future to work with the upcomingdynamicIO
rendering mode like adding'use cache'
or a<Suspense />
boundary.Therefore, if you use any features from
next-intl
on the client side, you should now make sure that aNextIntlClientProvider
wraps all relevant components (typically in the root layout):Note that also navigation APIs like
Link
rely onuseLocale
internally.