addons-actions: option to return something #31040
Closed
christophehurpeau
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
In recent version of Storybook (8.x, probably even late 7.x), the recommended way to use actions has changed. https://storybook.js.org/docs/essentials/actions You can do: import { fn } from '@storybook/test';
const meta: Meta<typeof Button> = {
component: Button,
args: { onClick: fn() },
}; Since Does that solve your use case? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
We have stories with callbacks that should return Promise.
Form onSubmit prop:
onSubmit: Promise<void>;
Describe the solution you'd like
Option to specify a return value, either with a function or directly the value we want to return ?
I'm not sure about the naming
Describe alternatives you've considered
onSubmit
return type to accept void.Are you able to assist to bring the feature to reality?
yes, I can
Additional context
reopening #11290 as it is still an issue and requested by several people
Beta Was this translation helpful? Give feedback.
All reactions