I am using Gatsby with @reach/router
, I have this simple router
<>
<Router basepath="/video">
<Auth path="/assessment/:keyId" />
</Router>
<Layout>
<Router basepath="/video">
<PrivateRoute path="/register/:keyId" component={Register} />
<PrivateRoute path="/tutorial/:keyId" component={Tutorial} />
<PrivateRoute path="/test/:keyId" component={Test} />
<PrivateRoute path="/questions/:keyId" component={Questions} />
<PrivateRoute path="/complete/:keyId" component={Complete} />
<PrivateRoute path="/personality/:keyId" component={Personality} />
<PrivateRoute path="/results/:keyId" component={Results} />
</Router>
</Layout>
</>
And On Layout
Component I have as simple as this:
<>
<Header />
{children}
</>
The problem is in <Auth/>
component. It renders with <Header/>
on it. Why? I'm wrapping a specific routes to render with <Layout/>
, everything but the <Auth/>
. What I am doing wrong? Any solutions?