Frontend Routing
You might have some questions:
- how does the frontend routing work ?
- how to add custom routes ?
Router file
It all begins with the react-router-dom router
Directorysrc
- router.tsx Frontend react-router-dom router
Inside this file is all the routing
If this documentation is up to date 😳, it will look like this:
You can see that it is creating dynamic paths, those paths will be determined with your backend adomin config.
To be clear, if you do not change the ADOMIN_*_PATH
variables, the following paths are created:
and here is an example if you configured adomin with the User model
Custom routes and overrides
If you want to override some page, let’s say the create and the update page for your resource User, you will be able to do so by using the makeOverridePage
helper, then put it somewhere in the router config, here is an example: