-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix(react): make wrapCreateBrowserRouter generic #6862
fix(react): make wrapCreateBrowserRouter generic #6862
Conversation
Reduces the Router and RouterState to the minimal internal usage, and makes the wrapper accept a generic which extends the minimal types. This allows for react-router to make changes to their Router types, without breaking our types.
So, I tried to make the internal types as minimal as possible, to only include the properties that are used in This works fine when I link the package up and try it out in a project. However the test suite fails, which I assume to be because this project uses TypeScript v3, while what I do most likely only works with v4. Edit: Nevermind, I think I got it to work after all. I'm not too happy typing things with |
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.
Thanks! Opened #6865 so we can make sure we catch this before users do.
@AbhiPrasad do note that this changes I'll try to add a default to the generic args to fix it. |
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.
Looks good to me! Thanks @h3rmanj.
@h3rmanj we'll try and get a release out with this fix early next week! |
Sounds good, thanks! |
Reduces the Router and RouterState to the minimal internal usage, and makes the wrapper accept a generic which extends the minimal types. This allows for react-router to make changes to their Router types, without breaking our types.
Fixes #6861
Before submitting a pull request, please take a look at our
Contributing guidelines and verify:
yarn lint
) & (yarn test
).