-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CustomRoutes not displaying in sidebar #9383
Comments
Hi @wallacer Custom Routes don't appear automatically in the menu, as we wouldn't know what label to use, or what to do with nested routes. You need to use a custom Menu to show them. |
Also from the doc: https://marmelab.com/react-admin/CustomRoutes.html#linking-to-custom-routes |
Got it, sorry about that. I was thinking the FWIW the other slightly confusing piece of documentation was noLayout. "By default, custom routes render within the application layout (with the menu and the app bar)". I had already landed on creating a custom |
You've got a point: the CustomRoutes doc could be improved. I made a PR for that: #9404. |
Here is my codesandbox where I created a SimpleCard component which just renders
<h1>Hello World!</h1>
inside aCard
. I've not passednoLayout
- and my component includes aTitle
component, so based on the docs.What you were expecting:
I expect my custom route for my simple card component to appear in the sidebar, with the title I've used - "Hello".
What happened instead:
Nothing changes in the sidebar, no matter whether the CustomRoute is used or not.
Steps to reproduce:
Use a
CustomRoutes
component, with or without aTitle
component in it, and without passingnoLayout
.Related code:
https://codesandbox.io/p/sandbox/condescending-booth-tqhch4
Environment
The text was updated successfully, but these errors were encountered: