Skip to content

React Router v7, Can't reuse a layout? #12868

Closed Answered by sergiodxa
skrichten asked this question in Q&A
Discussion options

You must be logged in to vote

You can do it by assigning a custom route id layout("routes/ScreenShader.tsx", { id: "custom" }, []).

The router generates a route id based on the file path, since the file is the same you need to customize it to use it multiple times.

Replies: 0 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@skrichten
Comment options

Answer selected by skrichten
# for free to join this conversation on GitHub. Already have an account? # to comment
Category
Q&A
Labels
None yet
2 participants