kruschid / typesafe-routes

Spices up your favorite routing library by adding type safety to plain string-based route definitions.
https://kruschid.github.io/typesafe-routes/
MIT License
102 stars 8 forks source link

getting bunch of errors when used with storybook #15

Closed Srujna closed 2 years ago

Srujna commented 2 years ago

I have a component where I have used useRouteParams of 'typesafe-routes/react-router' Component working fine however when I try to add this component to a storybook story, it is failing:

image image

Srujna commented 2 years ago

Can you please guide me where I am going wrong

kruschid commented 2 years ago

Hi @Srujna, it's a little difficult to say without seeing your code. But generally useRouteParams doesn't reference the location prop directly it rather depends on the react router context. Are you sure your storybook is running it within the said context?