Use at your own risk! Feel free to modify. They were customized for our code base and help to automate 90% of the migration our big React Router v5 app.
You will notice some data-exact
field on routes. Those are only needed while you have some merge requests still on v5 and some on v6. When your whole code base (including pending merge requests) is using v6 you can safely delete all those ESLint rules and you can just run a string-replace on your code base to remove data-exact="true"
and data-exact="false"
.
My two biggest gotchas during the migration:
- remix-run/react-router#8035 (comment)
- removing
state
fromto
Regarding the first point we created this file src/components/root-routes
that is also expected by one of the ESLint Rules: