Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temp: 2nd guide react router v6 upgrade DO NOT MERGE #379

Conversation

LiorKGOW
Copy link
Member

No description provided.

this component accesses the history from v5, sets up a listener
and then renders a "controlled" v6 <Router>
This way both v5 and v6 APIs are talking to the same history instance
CompatRoute renders a v5 Route wrapped inside of a v6 context
This makes both APIs available to the component tree
inside of this route
+ Convert a use of useHistory to useLocation
There is an error about InsightsRoute:
Uncaught Error: [Redirect] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>
at Routes (webpack-internal:///./node_modules/react-router-dom-v5-compat/node_modules/react-router/dist/index.js:1248:5)
    at InsightsRoutes (webpack-internal:///./src/InsightsRoutes.tsx:49:93)

This was the guide I was working with:
remix-run/react-router#8753

made it to just before this section: 6) Remove the compatibility package!
BUT the app did not work

(chore): Convert Switch to Routes of react-router

+ Convert CompatRoute to v6 Route
+ Convert Routes component name to InsightsRoutes
@LiorKGOW LiorKGOW added the wontfix This will not be worked on label Feb 12, 2024
@LiorKGOW LiorKGOW self-assigned this Feb 12, 2024
@LiorKGOW LiorKGOW closed this Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant