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
47 stars 11 forks source link

Support mock react-router state #2

Closed InfiniteXyy closed 2 years ago

InfiniteXyy commented 2 years ago

Sometimes a component should have a stateful location status.

Can we provide a way to mock the state, without calling the navigate funcition?

// To simulate this navigation
navigate("/inner", { state: "123" })
// We can config state for first page
parameters: {
    reactRouter: {
        path: "/inner",
        routeState: "123"
    }
}
JesusTheHun commented 2 years ago

Implemented in version 0.1.11.