Created
September 9, 2020 08:41
-
-
Save PaulieScanlon/14d66604fa2abf8424d866485b97dbb5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
// import { YourComponent } from 'your-directory' | |
export default { | |
title: 'components/Hackerman-3', | |
parameters: { | |
// component: YourComponent, | |
componentSubtitle: '...', | |
}, | |
} | |
export const Usage = () => <button>click me</button> | |
export const SomeButton = (args) => ( | |
<button onClick={(event) => args.handleClick(event)} value="Boogy Time"> | |
click me | |
</button> | |
) | |
SomeButton.parameters = { | |
docs: { | |
description: { | |
story: | |
"`args` are an absolute faff but basically you pass in whatever arguments you want, in this case it's the `handleClick` and is avaiable to the Story at `ags.handleClick`", | |
}, | |
}, | |
} | |
SomeButton.args = { | |
handleClick: (event) => alert(event.currentTarget.value), | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment