#not-found.tsx inside route groups
18 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
Why aren't you using a global layout?
Also putting the notfound.tsx in each of the route groups doesn't work?
cuz I have 2 whole different layouts with different providers on each of the layouts
Nah it gives me the default nextjs 404
Using a global layout is like surrounding your component with a div tag
It wont change anything
technicality you can import the layout form the group and import it into the root 404 page...
wouldn it mess with the performance if I have like 4 providers that aren’t even used on one side of the website
Wdym I did but it says it needs a layout
As i said, you can literally take the children from the param and return it
Ok I’ll try it brb
Also unless the route group is active the layout wont be loaded(iirc)
Put your providers in the route group layouts and in global root layout just return the children without any changes.
Thanks it worked 😄
I didn’t know you can still have a global layout if you already have them in the route groups
you can have a route group for any folder...