-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
DatePicker - Internationalization server client mismatch [NextJS 14.1.0 App Router] #6216
Comments
I can't seem to get your stackblitz to work, but I noticed you don't have a wrapping |
Thanks for taking the time @LFDanLu. Did you add routing locale? eg "en-US". I'm using /sv (swedish). I can't set the text manually either. That would work for me. Not sure if I would stumble into more strings that needs translation though. As for wrapping the app with I18nProvider - Since I'm using NextJS Im following the NextJS specific docs:
|
I might be having a brain fart, but when I open the stackblitz it just 404's after the packages are installed and
but looking at the code it doesn't look like LocalizedStringProvider does this in time, it sets a |
Yeah, the setup required isn't ideal here (probably a bug tbh), we'll probably want to change some docs in NextJS about this: https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#using-context-providers |
Thank you for sharing your thoughts about this! 🙌 @LFDanLu |
Provide a general summary of the issue here
NextJS 14.1.0 using App Router
When using DatePicker as instructed in documentation server client mismatch occurs.
To mitigate a rerender on client (adapting language) for some of the components we need to provide language information on server
I've followed the steps provided here
🤔 Expected Behavior?
The component should get correct language on SSR and not need to correct it on client.
😯 Current Behavior
The component doesn't render correct language on SSR, corrects on client resulting in a server client mismatch
💁 Possible Solution
No response
🔦 Context
No response
🖥️ Steps to Reproduce
https://stackblitz.com/edit/nextjs-arbvzx?file=components%2FDatePicker.tsx
Version
react-aria-components 1.1.1
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
Windows 10
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered: