-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
feat: Add auto state controls (fix #191) #673
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
✅ Deploy Preview for histoire-examples-svelte3 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for histoire-examples-vue3 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for histoire-controls ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for histoire-site ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
When will this version land in npmjs? |
@alexzhang1030 It's already available. Keep in mind that the auto state should be displayed only if no custom controls are provided. Here is an example: https://github.com/histoire-dev/histoire/blob/main/examples%2Fvue3%2Fsrc%2Fcomponents%2FAutoStateProps.story.vue |
Thank you, it's released now, but I saw the version in npm is still |
Fix #191
Description
Add placeholder with default value when auto-detected props are undefined

Add auto state controls when there are no template#controls and initState exists.

Additional context
Displaying default values like the issue suggests is not a good solution IMO, as if the same state value is used for two props, the values would be unlinked.
I think generating automatic controls for the state should solve the issue mentioned. Wdyt?
What is the purpose of this pull request?