_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.

10 Replies
useful-bronze•14mo ago
do you have your routes in a
_authenticated
subfolder next to _authenticated.tsx
?fascinating-indigoOP•14mo ago
No, _authenticated.tsx is in the root of the routes folder.
useful-bronze•14mo ago
then it won't work
fascinating-indigoOP•14mo ago
Oh.
useful-bronze•14mo ago
routes need to be within the layout route
see this example
useful-bronze•14mo ago
React TanStack Router Authenticated Routes Example | TanStack Route...
An example showing how to implement Authenticated Routes in React using TanStack Router.
fascinating-indigoOP•14mo ago
It doesn't say in the docs that I have to do that.
Thank you.
useful-bronze•14mo ago
this does use the flat syntax (_auth.invoices.tsx for example)
fascinating-indigoOP•14mo ago
So I have to create an
_auth.${route}.tsx
for all routes?useful-bronze•14mo ago
either that or put it into a folder named _auth