-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
feat: forward parsePath
and createPath
from history
#8278
Conversation
We can expose |
I see. Let me check what I am using in my code |
This is what we use: Values:
Types:
|
As Michael said, we anticipate some major changes to history and don't want to couple that API to React Router's. In v6, history even became an internal dependency.
|
parsePath
and createPath
from history
@ryanflorence - I updated the PR with only the relevant exports. Is this good? |
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.
@KutnerUri I think this looks good - one callout about also exporting Search
, and then there's some conflicts likely due to a recent prettier
change in dev
. If you wouldn't mind getting those fixed up, I think this is in good shape to merge 👍
@brophdawg11 done, go ahead |
@KutnerUri Can you also add your name to the CLA signature file? That's required for merging. |
@timdorr - what is that? the |
Ah, apologies, you started this PR before the bot was in place, so it never posted its comment here. That looks like this: #8689 (comment) But yes, you should add your username to that file. |
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳 |
@timdorr - any idea why this test is failing?
I am clearly forwarding the export from |
wait I see it.. |
There we go. Thanks! |
parsePath
and createPath
from historyparsePath
and createPath
from history
When using React Router, it is common to use advanced history methods, like
parsePath
andcreatePath
.React Router has a strong dependency on History, so whenever RR updates, or history releases a new version, we get errors (usually just types) and are forced to match our application History with the current version of History RR's is using. It's frustrating.
We literally just use History to use RR's features.
For this reason, it makes sense to forward History from React Router, or just the methods RR is using (
parsePath
,createMemoryHistory
(?),createBrowserHistory
,createHashHistory
,createPath
).(I can make a separate PR for that, if you'd like)
It is cheap, and create a lot of value for the community.