Replies: 1 comment 1 reply
-
Next.js is unfortunately a bit inconsistent with this currently. If you check the internationalization guide from Next.js, it contains this statement:
I found that practically the pass-through layout is sometimes required and doesn't cause any issues. I think this will finally be resolved cleanly in Next.js once |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have been trying to understand the correct way of using not-found.tsx in app root. Next.js documentation states:
The layout above is called a root layout because it's defined at the root of the app directory. The root layout is required and must contain html and body tags. [0]
next-intl documentation gives an example [1]:
// Since we have a root
not-found.tsx
page, a layout file// is required, even if it's just passing children through.
export default function RootLayout({children}) {
return children;
}
The given example does not contain html and body tags, even though Next.js "requires" for these tags to be used for root layout.
How to reconcile these differences? From a practical stand point, not using html tags in root layout seems to work fine, but maybe it causes instability down the line?
Thanks,
Tadas
[0] https://nextjs.org/docs/app/getting-started/layouts-and-pages
[1] https://next-intl.dev/docs/environments/error-files
Beta Was this translation helpful? Give feedback.
All reactions