Replies: 1 comment
-
Here's what I've done: export const Main: Story = {
args: {
prop1: '#ffffff',
prop2 200,
prop3: 100,
}
};
Main.parameters = {
controls: {include: Object.keys(Main.args)}
} This includes only the controls that have been defined in args, you could use argTypes if you wish |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a situation where I have a specific set of props defined in
args
&argTypes
and I don't need to see any of the automatically inferred ones. But what actually happens, is that I get to see both.How can I disable automatically inferred args for a single story? I prefer not to write it like this:
That's a bit too un-DRY to me, and it also "breaks" when adding more props, and forgetting to disable them too.
Rather I'm looking for something generic:
(this doesn't work; it just serves as a proposal)
I couldn't find this either here, nor here. (two different documentations for what seems to be the same feature, is that right?)
Neither of these appear to provide a full comprehensive reference to
args
orargTypes
. Only the former one mentions auto inferrence very subtly, which makes it look to me like kind of a hidden feature. Very cool, but not for this one story I've got 🙂Alternatively, it would be helpful if automatic inference wouldn't do anything as soon as custom
args
are used. Not sure if this is the best solution though, because I can see the advantage of having both in some cases.Beta Was this translation helpful? Give feedback.
All reactions