Open thurt opened 7 years ago
@thurt It seems like action does not work if it is wrapper inside function.
This works.
<Touchable
onActionsPress={action('Action 2 clicked')}
/>
This does not work
<Touchable
onActionsPress={() => {action('Action 2 clicked')}}
/>
Because in here storybook action
creates new function.
https://github.com/storybooks/storybook/blob/master/addons/actions/src/preview.js#L35
so your action function must be called on int. not on click. This may work
<Touchable
onActionsPress={() => { return action('Action 2 clicked')}.call()}
/>
Given code in
src/stories/Touchable.js
:I do not see any action being reported when clicking the button in the storybook client's "action logger" pane.
RecordIt video of bug: http://recordit.co/bKuLASDBcQ