I simply want all of my admin pages to be under /admin
.
<Admin
title="Admin"
dashboard={Dashboard}
dataProvider={restClient}
history={history}
>
<Resource
name="users"
list={UserList}
/>
</Admin>
My main page is at /admin
but when I click Users in the sidebar, it changes the path to /users
and not /admin/users
.
I'm using react-admin 2.0.0.
The key is actually in the history prop passed to the Admin component:
import createHistory from 'history/createBrowserHistory';
const history = createHistory({ basename: '/admin' });
<Admin history={history} />