JesusTheHun / storybook-addon-remix-react-router

Use your app router in your stories. A decorator made for Remix React Router and Storybook
Apache License 2.0
45 stars 11 forks source link

Allow shouldRevalidate param to control when loader should fire on route change #29

Closed FluffyPorkBuns closed 1 year ago

FluffyPorkBuns commented 1 year ago

Allow shouldRevalidate param

It would be nice if the shouldRevalidate param could be passed into the router for when you're using a loader for your component, that way you have control over when the loader should and shouldn't fire on route changes. Right now if you are using a loader, it will fire each time the route changes (like if your component updates search params) and this could lead to undesirable repeated API calls.

https://reactrouter.com/en/main/route/should-revalidate

JesusTheHun commented 1 year ago

This has been implemented in the latest version. Can you check and tell me if everything work as expected for you ?