-
Notifications
You must be signed in to change notification settings - Fork 164
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
Conversation
38bf868
to
d32a260
Compare
d32a260
to
a1d8282
Compare
...props | ||
}) => { | ||
const navigate = useNavigate(); | ||
const href = useHref(typeof to === 'string' ? { pathname: to } : to); |
There was a problem hiding this comment.
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.
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. |
@kyletsang anything else required to change in this PR or shall we follow-up with something? |
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! |
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.