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
50 stars 12 forks source link

Unable to interact with stories using controls (args) #26

Closed jasonlawmh closed 1 year ago

jasonlawmh commented 1 year ago

After upgrading to v0.3.5, no longer able to interact stories with storybook controls. I tried to clone this project and updated the RenderChildren story to accept a prop. The screen renders 42 correctly, however if I update the id from the controls. It doesn't update the id as expected


export const RenderChildren = {
  render: ({ id }: { id: string }) => <h1>{id}</h1>,
  args: {
    id: "42",
  },
};
d-Pixie commented 1 year ago

I have the same issue, both with args from controls and fixtures from the storybook-fixtures decorator. The changes reach the story, I can log them in the story code just before the component renders, but the component doesn't get updated. Updates that go through the URL work - this is in pagination component that pulls most of its data from the URL - and the component updates, but changing other arguments via controls etc doesn't work. If I remove the withRouter decorator everything works as expected.

I also tried changing som value using controls and then changing the URL params to "force" a re-render of the component, but that doesn't work either. The component is updated with the correct value for the URL provided arg, but not the other one.

Any thought on this @JesusTheHun ? Feels like a super strange place for it to happen. I would expect it to not reach the story renderer at all ... Are you keeping an old instance of the rendered story somehow? Only way I could come up with that would cause this 🙂

JesusTheHun commented 1 year ago

Thank you for your reports guys. Can you tell me which is the last version that worked for you?

JesusTheHun commented 1 year ago

I've pushed a new version addressing your issue. Can you confirm it is resolved for you ?

EDIT : hm, I missed something the CI caught up... brb EDIT 2 : we're done 🎉

JesusTheHun commented 1 year ago

@jasonlawmh @d-Pixie waiting for your input to close this issue :)

spicattutti commented 1 year ago

Great, thank you :) Checking now

spicattutti commented 1 year ago

Updating to 0.3.6 fixed the issue for me 🎉.

Sometimes a change in the docs panel makes the whole page hang for ages, but that is probably some other issue that came with the update to SB v7.

But generally updating docs now updates the story canvas 👍

jasonlawmh commented 1 year ago

Thank you! 0.3.6 works perfectly for me too. 💯