Fire action in story when button is pressed
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
||||||
import { RecoilRoot } from 'recoil';
|
import { RecoilRoot } from 'recoil';
|
||||||
|
import { action } from '@storybook/addon-actions';
|
||||||
import { FollowerCollection } from './FollowerCollection';
|
import { FollowerCollection } from './FollowerCollection';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -12,8 +13,8 @@ export default {
|
|||||||
const Template: ComponentStory<typeof FollowerCollection> = (args: object) => (
|
const Template: ComponentStory<typeof FollowerCollection> = (args: object) => (
|
||||||
<RecoilRoot>
|
<RecoilRoot>
|
||||||
<FollowerCollection
|
<FollowerCollection
|
||||||
onFollowButtonClick={function (): void {
|
onFollowButtonClick={() => {
|
||||||
throw new Error('Function not implemented.');
|
action('Follow button clicked');
|
||||||
}}
|
}}
|
||||||
name="Example stream name"
|
name="Example stream name"
|
||||||
{...args}
|
{...args}
|
||||||
|
|||||||
Reference in New Issue
Block a user