Hidratation problem with Internacionalization
Answered
JChicano posted this in #help-forum
JChicanoOP
I followed the documentation of next (without installing libraries), and i have the layout like the image, the web is working well but i have this problem
22 Replies
JChicanoOP
The problem is that the component renders gives a 404 error and then loads the language and works correctly, this causes a hydration error, so I want to know if the parameters that I am passing to the component and the form are appropriate or not, since I don't really know if you have to do an await or a promise or whatever
@JChicano I followed the documentation of next (without installing libraries), and i have the layout like the image, the web is working well but i have this problem
the code here looks fine... can you make a minimal reproduction repository?
and the steps to reproduce this bug
JChicanoOP
@joulev the code here looks fine... can you make a minimal reproduction repository?
JChicanoOP
i think that the problems can be in this two files
no... they look fine to me
it looks good as well
@JChicano Click to see attachment
ah yeah the issue is here
Answer
@JChicano Click to see attachment
yeah exactly
JChicanoOP
And how should I put it?
yeah just do
const { lang } = await params
at the top and use lang
or this pattern which i prefer:
instead of
you'd do
instead of
function Page({ params }) {
const lang = (await params).lang;
}
you'd do
function Page(props) {
const params = await props.params;
// use params.lang here
}