T
TanStack14mo ago
fascinating-indigo

_authenticated.tsx doesn't work.

I have the code in the attached screenshot in an _authenticated.tsx file in the "routes" directory but nothing happens.
No description
10 Replies
useful-bronze
useful-bronze14mo ago
do you have your routes in a _authenticated subfolder next to _authenticated.tsx?
fascinating-indigo
fascinating-indigoOP14mo ago
No, _authenticated.tsx is in the root of the routes folder.
useful-bronze
useful-bronze14mo ago
then it won't work
fascinating-indigo
fascinating-indigoOP14mo ago
Oh.
useful-bronze
useful-bronze14mo ago
routes need to be within the layout route see this example
useful-bronze
useful-bronze14mo ago
fascinating-indigo
fascinating-indigoOP14mo ago
It doesn't say in the docs that I have to do that. Thank you.
useful-bronze
useful-bronze14mo ago
this does use the flat syntax (_auth.invoices.tsx for example)
fascinating-indigo
fascinating-indigoOP14mo ago
So I have to create an _auth.${route}.tsx for all routes?
useful-bronze
useful-bronze14mo ago
either that or put it into a folder named _auth

Did you find this page helpful?