How can I create a custom page with #react-admin without the menu sidebar like login page?

thecassion picture thecassion · Jul 10, 2018 · Viewed 7.9k times · Source

I am using react-admin previously admin-on-rest. I want to create a custom page that doesn't show the Menu sidebar, like Login page. I will use this page reset user's password. How can I do that?

Answer

Gildas Garcia picture Gildas Garcia · Jul 14, 2018

This is not obvious in the documentation but the Route actually accepts a noLayout prop:

<Admin
    customRoutes={[
        <Route
            path="/custom"
            component={CustomRouteNoLayout}
            noLayout
        />,
        <Route
            path="/custom2"
            component={CustomRouteWithLayout}
        />,
    ]}
>