You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm migrating a legacy app that uses connected-react-router, which is tied to React Router 5.
Instead of trying to use some other package, I'm simply copying the connected router code into the repo, and adjusting the React Router parts to adjust to the updated "history" package.
All is fine, but I've now come to the point where I need to replace the old getUserConfirmation api, and the only way to do that with RR 6 is to use the useBlocker api, which depends on using a data router.
In order for the app to work correctly, I need to maintain the old behavior of connected react router, so that its the redux state that drives the router.
This is achieved with the base Router component, like this:
Is there any way to achieve this with data routers? Meaning, can a data router be driven by an external history object, or does it need to control this state itself?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm migrating a legacy app that uses connected-react-router, which is tied to React Router 5.
Instead of trying to use some other package, I'm simply copying the connected router code into the repo, and adjusting the React Router parts to adjust to the updated "history" package.
All is fine, but I've now come to the point where I need to replace the old getUserConfirmation api, and the only way to do that with RR 6 is to use the useBlocker api, which depends on using a data router.
In order for the app to work correctly, I need to maintain the old behavior of connected react router, so that its the redux state that drives the router.
This is achieved with the base Router component, like this:
Is there any way to achieve this with data routers? Meaning, can a data router be driven by an external history object, or does it need to control this state itself?
Beta Was this translation helpful? Give feedback.
All reactions