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

Remounting story with withRouter decorator gives "two children with the same key" error #23

Closed ningxie1991 closed 1 year ago

ningxie1991 commented 1 year ago

I have a story using the withRouter decorator. When I change some control props and click the remount addon button to reload the story, I get the below warning/error.

This is the remount button from the addon essentials:

image

I also have a theme switcher addon that remounts the story by updating the story key every time a theme is chosen. This flow also triggers the same error from the react-router-v6 addon.

image

Warning:

image

The duplicated key is storybook/react-router-v6/story-loaded_0. Could someone take a look on how to get rid of this warning/error? Thanks!

JesusTheHun commented 1 year ago

Thank you for opening an issue. A new version is available to fix this issue, v0.3.5. Can you confirm the issue is fixed on your side ?

ningxie1991 commented 1 year ago

Thanks for the quick fix. I just verified that this issue has been fixed and I don't see this warning anymore. Thanks!