T
TanStack9mo ago
yappiest-sapphire

Change `<html>` `lang` attribute in subroute

Is there a way to change the <html> lang attribute in a nested route (e.g. /$lang) based on URL params? Thanks
4 Replies
dependent-tan
dependent-tan9mo ago
react 18 or 19?
yappiest-sapphire
yappiest-sapphireOP9mo ago
If it's different: both since I'm currently in 18 but we plan to upgrade in a month or two to 19
dependent-tan
dependent-tan9mo ago
you should be able to check the matches array in the root route and read the path param or even do a useParams({strict: false})
yappiest-sapphire
yappiest-sapphireOP9mo ago
Nice thanks 👍

Did you find this page helpful?