react-router-typesafe
react-router-typesafe copied to clipboard
add options to typesafeBrowserRouter
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.
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!
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
I managed to infer the options type from the createBrowserRouter function. Added a simple test just to test Typescript correctly infers the type.
any news on this? Still have the need for it :D