Open
Description
opened on Sep 26, 2023
This is a Tracker Issue for all react-router-dom related upgrades.
- Add the react-router compatibility package to merge v5 and v6 APIs according to the official migration guide: Official v5 to v6 Migration Guide remix-run/react-router#8753 and https://reactrouter.com/en/6.16.0/upgrading/v5 -- Setup router compatibility package for react-router-dom v6 upgrade #1970
- Replace react-router compatibility package usage with v6 imports.
- Upgrade each
Route
defined insideindex.jsx
to use v6 API.- Use relative links instead of nested links.
- Replace nested components with
elements
attribute. Example commit here. - Use
<Outlet />
instead ofprops.children
to render nested routes inside<Page />
. Example commit here. - Test thoroughly and ship
- Upgrade each
Useful resources:
- React Router v6 Migration Guide: https://reactrouter.com/en/main/upgrading/v5
- React Router Compatibility Package usage and guide: Official v5 to v6 Migration Guide remix-run/react-router#8753
- Sample commit showcasing the usage of
<Outlet />
and<Switch>
components: ff22e64 (This commit was created as a part of the migration but is just a part of the story since it doesn't fixes the nested routing APIs and also doesn't use v6 Link component)
Activity