Skip to content

Don't use randomly generated IDs in actions #1109

@marcfallows

Description

@marcfallows

In our storybooks we use seedrandom to seed Math.random because we use them for visual regression. That means that the randomly generated IDs can result in duplicate keys:

Randomly generated id: https://github.com/storybooks/storybook/blob/master/addons/actions/src/preview.js#L16

Use of the ID in a key: https://github.com/storybooks/storybook/blob/master/addons/actions/src/components/ActionLogger/index.js#L22

And we all know how React feels about duplicated keys... 😞

Could a uuid be used instead?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions