How to have a layout route not apply to the index route #3164
Unanswered
Isaac-Leonard
asked this question in
Q&A
Replies: 2 comments 2 replies
-
can you please provide a complete minimal example by forking one of the existing examples on stackblitz? |
Beta Was this translation helpful? Give feedback.
2 replies
-
You could check if you're directly on the index route with
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've got a subdirectory at "/routes/play" that has a layout route at "/routes/play/route.tsx" which wraps every file in that subdirectory properly.
In "/routes/play/route.tsx" I've got a back button at the top of the page that will take the user to the parent directory of what ever route they are currently on.
My issue is that I don't want this button to render on "/routes/play/index.tsx"
Is there a way to not use the layout component for the index file or otherwise use some path matching logic in the layout component to conditionally render the back button if the "routes/play/index.tsx" page is rendered?
I've tried reading the docs and some related discussions but the naming conventions seem to all be confused and I couldn't find a proper way to make it work.
For context my layout component looks like this:
Beta Was this translation helpful? Give feedback.
All reactions