Skip to content

Two Questions about Wouter #399

Answered by molefrog
destocot asked this question in Q&A
Dec 26, 2023 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Hi @destocot,

i create a new ticket from that page i wont get redirected? is this intended?

Could you clarify? Does it change the URL when you call setLocation()?

Regarding layouts, we don't have first-class support for it. However, you can extend the Route component like so:

const RouteWithLayout = ({ layout, component, ...props }) => {
  const Page = component; // component names should start with capital letter in React
  const Layout = layout;

  return <Route {...props}><Layout><Page /></Layout></Route>
}

<RouteWithLayout path="/signin" component={SigninPage} layout={AuthLayout} />

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

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

Answer selected by destocot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants