mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-20 05:02:37 +08:00
Add stories to reproduce #11586
This commit is contained in:
parent
1dad48483b
commit
36e5acf484
@ -44,17 +44,25 @@ export default {
|
||||
],
|
||||
};
|
||||
|
||||
export const PassedToStory = (inputArgs) => {
|
||||
const Template = (args) => {
|
||||
return (
|
||||
<div>
|
||||
<h3>Input args:</h3>
|
||||
<pre>{JSON.stringify(inputArgs)}</pre>
|
||||
<pre>{JSON.stringify(args)}</pre>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const PassedToStory = Template.bind({});
|
||||
|
||||
PassedToStory.argTypes = { name: { defaultValue: 'initial', control: 'text' } };
|
||||
|
||||
PassedToStory.propTypes = {
|
||||
args: PropTypes.shape({}).isRequired,
|
||||
export const OtherValues = Template.bind({});
|
||||
|
||||
OtherValues.argTypes = { name: { control: 'text' } };
|
||||
|
||||
export const DifferentSet = Template.bind({});
|
||||
DifferentSet.args = {
|
||||
foo: 'bar',
|
||||
bar: 2,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user