

#REACT ROUTER DOM DOCS HOW TO#
We'll pass the routerProvider prop to the Refine component to instruct refine on how to communicate with the router.

In our examples, we've used this approach to demonstrate the flexibility of the router provider and the route handling process. From basic to advanced use cases and enterprise applications, you will have full control over your routes. If you would like to use react-router-dom v5 instead, please refer to: react-router-sample. You can find a full sample apps that implement this for react-router-dom, Next.js and Gatsby. You can define your routes the way you want, then pass the routerProvider prop to the Refine component and use the resources prop to define the resources and their action paths. The example below will show how to implement this for react-router-dom. Usage is not restricting you to use the router in a specific way and it is up to you to decide how you want to use it. If you are using the legacy router provider, it can be imported from and passed to the legacyRouterProvider prop of the Refine component. Other than this one small difference the libraries work almost exactly the same. If you are using React Native you will need to install react-router-native instead. This library specifically installs the DOM version of React Router. It is recommended to use the new router provider instead of the legacy one. In order to use React Router on the web you need to run npm i react-router-dom to install React Router. Also exports the legacy router provider and it will be available until the next major version of refine.
