Skip to content

Commit

Permalink
examples: fix next-translate prod hydration error in layout (#52653)
Browse files Browse the repository at this point in the history
Co-authored-by: Lee Robinson <me@leerob.io>
  • Loading branch information
aralroca and leerob committed Aug 15, 2024
1 parent 1bf2b74 commit 2865e18
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions examples/with-next-translate/app/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,31 @@ export const metadata = {
};

export default function Layout(props) {
const { t } = useTranslation();
const { t, lang } = useTranslation();

return (
<div className="container">
{props.children}
<footer>
<span>{t("common:powered")} </span>
<a href="https://vercel.com" target="_blank" rel="noopener noreferrer">
▲ vercel
</a>
<span>&amp;</span>
<a
href="https://github.com/vinissimus/next-translate"
target="_blank"
rel="noopener noreferrer"
>
next-translate
</a>
</footer>
</div>
<html lang={lang}>
<body className="container">
{props.children}
<footer>
<span>{t("common:powered")} </span>
<a
href="https://vercel.com"
target="_blank"
rel="noopener noreferrer"
>
▲ Vercel
</a>
<span>&amp;</span>
<a
href="https://github.com/vinissimus/next-translate"
target="_blank"
rel="noopener noreferrer"
>
next-translate
</a>
</footer>
</body>
</html>
);
}

0 comments on commit 2865e18

Please sign in to comment.