react-router-typesafe icon indicating copy to clipboard operation
react-router-typesafe copied to clipboard

add options to typesafeBrowserRouter

Open reinfi opened this issue 1 year ago • 4 comments

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.

reinfi avatar Jun 03 '24 19:06 reinfi

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 avatar Jun 04 '24 08:06 fredericoo

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

fredericoo avatar Jun 17 '24 08:06 fredericoo

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

reinfi avatar Jun 20 '24 20:06 reinfi

any news on this? Still have the need for it :D

reinfi avatar Feb 09 '25 07:02 reinfi