Closed bastienrobert closed 3 years ago
About this:
Maybe it would be possible to customize these names to make groups more verbose.
Maybe we could read a props on children components (like __groupId
) in the stories to get more verbose names?
Seems like I'm having another issue when using addon-docs. If component is not wrapped, it doesn't receive props properly in the doc page. I have to do something like:
const Wrapper = (props) => <MyComponent {...props} />
export const Story = () => <Wrapper foo="bar" />
I just don't understand why it does have this behavior.
Could you merge in the base branch please?
I just did it @ndelangen but maybe it'll be necessary to check this : https://github.com/storybookjs/addon-smart-knobs/pull/75#issuecomment-602032718 and to fix this : https://github.com/storybookjs/addon-smart-knobs/pull/75#issuecomment-602291443 ?
That's strange, that behavior should just work, I think you're using CSF there?
Yes I am. I just wanted to start with a basic setup before looking to make it works with MDX Syntax (because I'm using Typescript).
Maybe another PR to add more documentation on how to setup Storybook docs with Typescript and MDX here storybook docs could be cool ?
@shilman is working on a replacement for knobs that has this auto-feature built-in btw.
Any PR improving the docs would be welcome!
Ok, that's cool! Maybe you have a date for a release? 🙃
6.0.0 is scheduled for release next month or so. It depends on how many bugs we find during prereleases.
Hi, folks! Can you talk about the status of this PR? I using 6.0.2 but I have the same problems with my multiple components.
Just a note that Storybook v6 and @storybook/addon-essentials
have been released, including the "Controls" addon. You can think of Controls as smart knobs, with the added benefit that they can be embedded on Docs pages using ArgsTable
.
I am not a maintainer, but I'd consider this addon effectively dead since Controls have resolved all open issues I had with Smart Knobs (including this one) and leapfrogged it in terms of functionality.
I agree with @chriszarate, this PR is clearly useless for v6 because this addon is useless for v6.
@nikshevchenko I don't think having multiple components in the same story is a good practice. Is your code opensource or could you setup a bug repro? Can't help without more informations.
@ndelangen is this repo going to be archived or do you want to keep it active? Maybe this question should be in another issue?
@bastienrobert I think it's best archived, I'll ask @shilman
If the same component is several times in the same story, groups are automatically generated based on the children's index in order to put them in tabs and prevent conflicts between props.
Also, it fix the documentation page issue in storybook/addon-knobs.
Maybe it would be possible to customize these names to make groups more verbose.
Fix. https://github.com/storybookjs/addon-smart-knobs/issues/71