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

add options to typesafeBrowserRouter #17

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

reinfi
Copy link

@reinfi reinfi commented Jun 3, 2024

Hi,

I am missing the possibility to use the options on the browserRouter.

https://reactrouter.com/en/main/routers/create-browser-router

Sadly the DOMRouterOpts is not exported therefore I simply copied it with the types from base package.
If you have a better solution for that, just let me know.

I did not add any tests, cause I am not really familiar with testing-library. Just let me know how to test this.

@fredericoo
Copy link
Owner

I like this idea but I think we should completely infer it from the library, not re-declare it, otherwise maintenance will be hard. Let me have a stab at it later today!

@fredericoo
Copy link
Owner

Actually my life is a bit of a mess right now, can you have a stab at inferring it from the library instead of declaring? I’m happy to review just in complete mayhem right now

@reinfi
Copy link
Author

reinfi commented Jun 20, 2024

I managed to infer the options type from the createBrowserRouter function. Added a simple test just to test Typescript correctly infers the type.

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.

2 participants