Next.js Discord

Discord Forum

i18next - html attribute rerendering behavior

Unanswered
Collared Forest-Falcon posted this in #help-forum
Open in Discord
Collared Forest-FalconOP
Had a quick question regarding i18n via app router - when the user changes the language on the client side, the lang attribute on <html> updates and throws the following error:
You are mounting a new html component when a previous one has not first unmounted. It is an error to render more than one html component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <html> and if you need to mount a new one, ensure any previous ones have unmounted first.


Did anyone ever run into this? if so, what did you do to get around this?
I was thinking about removing the lang html so they dont rerender by just offloading to the child component, but wanted to check if anyone has a simpler solution!

0 Replies