Skip to content

State in storybook #1

@daanvdk

Description

@daanvdk

DatePicker and DateRangePicker are both always controlled components. Thus if we want interactive examples in storybook with state we need to somehow keep the state in storybook.

I tried this approach: https://github.com/storybooks/storybook/blob/4b5622a1c1d8d4cc44160b659289f954e8740b13/examples/cra-kitchen-sink/src/stories/force-rerender.stories.js

Which didn't work for me, the component would rerender but somehow the value prop would not be updated.

For now I just added two versions of both components, one without and one with data filled in, but that is obviously not ideal.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions