Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

State in storybook #1

Open
daanvdk opened this issue May 23, 2019 · 0 comments
Open

State in storybook #1

daanvdk opened this issue May 23, 2019 · 0 comments
Assignees

Comments

@daanvdk
Copy link
Collaborator

daanvdk commented May 23, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants