Skip to content

feat: added support for React Router 6 #260

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

Merged
merged 1 commit into from
Nov 17, 2021
Merged

Conversation

mxschmitt
Copy link
Member

@mxschmitt mxschmitt commented Aug 27, 2020

Not sure if it was worth it.

There were quite a lot of changes in React router 6: https://github.com/ReactTraining/react-router/blob/dev/docs/advanced-guides/migrating-5-to-6.md

Fixes #259

We would need a minor release after that since <6 seem to be not supported anymore.

@mxschmitt mxschmitt force-pushed the upgrade-react-router branch from 38bf868 to d32a260 Compare August 27, 2020 17:30
@mxschmitt mxschmitt force-pushed the upgrade-react-router branch from d32a260 to a1d8282 Compare August 27, 2020 17:36
@mxschmitt mxschmitt requested review from kyletsang and taion August 27, 2020 17:37
@mxschmitt mxschmitt changed the title chore: added support for React Router 6 feat: added support for React Router 6 Aug 27, 2020
...props
}) => {
const navigate = useNavigate();
const href = useHref(typeof to === 'string' ? { pathname: to } : to);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just pass to here as is? Looks like useHref will parse both object and string forms.

@mxschmitt mxschmitt requested a review from jquense August 28, 2020 13:32
@jquense
Copy link
Member

jquense commented Sep 2, 2020

I'm not well equipped to review this since i don't use react-router!

@mxschmitt
Copy link
Member Author

I'm not well equipped to review this since i don't use react-router!

Then I would say let's wait if more users request that change and then decide to ship it.

@mxschmitt
Copy link
Member Author

@jquense seems like #262 is one of the first users who face into that issue. Lets release a major version with v6 support or what's your opinion on that?

@mxschmitt mxschmitt closed this Aug 24, 2021
@mxschmitt mxschmitt reopened this Nov 16, 2021
@mxschmitt
Copy link
Member Author

@kyletsang anything else required to change in this PR or shall we follow-up with something?

@kyletsang
Copy link
Member

I think this should be good. I'll play around with it after it's merged and see if there's anything extra to add. Thanks for making all these changes!

@mxschmitt mxschmitt merged commit c12b9d0 into master Nov 17, 2021
@kyletsang kyletsang deleted the upgrade-react-router branch November 22, 2021 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception with react-router v6: (0, _reactRouterDom.withRouter)(LinkContainer) is not a function
3 participants