This repository has been archived by the owner on Nov 10, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from kadirahq/add-readme
Add a basic README
- Loading branch information
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,19 @@ | ||
# Storybook Addon: Action Logger | ||
# Action Logger Addon | ||
|
||
The Action Logger addon can be used to display data received by event handlers. This addon works with both [React Storybook](https://github.com/kadirahq/react-storybook) and [React Native Storybook](https://github.com/kadirahq/react-native-storybook) (included by default). | ||
|
||
![](docs/screenshot.png) | ||
|
||
To use the action logger, import the `action` function and use it to create actions handlers. When creating action handlers, provide a name to make it easier to identify. | ||
|
||
```js | ||
import { storiesOf } from '@kadira/storybook' | ||
import { action } from '@kadira/storybook-addon-actions' | ||
|
||
storiesOf('Button', module) | ||
.add('default view', () => ( | ||
<Button onClick={ action('hello') }> | ||
Hello World! | ||
</Button> | ||
)) | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.