Skip to content

Render pages NOT in routes export #34

@colin-byrne-1

Description

@colin-byrne-1

Hey I am using dashboard 2.0 and would like to render a 404 page.

I would NOT like the 404 page to show up in the sidebar. I would like to render it with the AdminLayout, and redirect to the 404 page whenever another route is not found.

The below code is not working, but I think it shows my intentions.

    <Switch>
        <Route exact path="/" component={HomeView} />
        <Route path="/auth" render={props => <AuthLayout {...props} />} />
        <Route path="/admin" render={props => <AdminLayout {...props} />} />
        <Route path="/404" render={props => <AdminLayout component=NotFoundPage {...props} />} />
        <Redirect to="/404" />
    </Switch>
);

Thanks for any help, the dashboard has been great.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions