Upgraded xarc-react-router package.json to current dependencies.
Refactored react-router-node.tsx and react-router-browser.tsx files to work with react-router V6.
Key Changes
React Router v6 uses Routes component instead of Switch.
Router does not support history prop anymore. We replaced it with HistoryRouter for that reason.
StaticRouter does not support context prop anymore.
How to Test
Navigate to packages/xarc-react-router/src/ directory
Run fyn && fun text
Key Notes
unstable_HistoryRouter as HistoryRouter is used here instead of <Router> because reactrouter v6 removed history prop support for <Router>. This API is currently prefixed as unstable because you may unintentionally add two versions of the history library, the one you have added to the package.json and whatever version React Router uses internally. Once react-router has a mechanism to detect mis-matched versions, this API will remove its unstable_ prefix. https://reactrouter.com/docs/en/v6/routers/history-router.
For now, use the unstable_HistoryRouter version here.
Description
react-router-node.tsx
andreact-router-browser.tsx
files to work withreact-router
V6.Key Changes
Routes
component instead ofSwitch
.Router
does not supporthistory
prop anymore. We replaced it withHistoryRouter
for that reason.StaticRouter
does not support context prop anymore.How to Test
packages/xarc-react-router/src/
directoryfyn && fun text
Key Notes
unstable_HistoryRouter as HistoryRouter
is used here instead of<Router>
because reactrouter v6 removed history prop support for<Router>
. This API is currently prefixed as unstable because you may unintentionally add two versions of the history library, the one you have added to the package.json and whatever version React Router uses internally. Once react-router has a mechanism to detect mis-matched versions, this API will remove its unstable_ prefix. https://reactrouter.com/docs/en/v6/routers/history-router. For now, use the unstable_HistoryRouter version here.