I need to create a layout that only applies to certain routes. However, when I use a Switch and separate the routes that need alternate layouts, if I try to visit a page that doesn't exist it just takes me to the layout with nothing inside of it. Here is the sample code.
<Switch>
<Route exact path="/" component={SampleComponent} />
<TokenLayout>
<Route path="/some-random-component" component={SomeRandomComponent} />
</TokenLayout>
<Route path="*" component={NotFound} />
</Switch>
the NotFound component never renders, instead it renders the TokenLayout with no children.
Any suggestions on how to resolve this?