Skip to content

Commit

Permalink
Merge pull request #1793 from storybooks/joscha/linkto-docs
Browse files Browse the repository at this point in the history
docs: linkTo
  • Loading branch information
ndelangen authored Sep 5, 2017
2 parents 2b0c8ab + 7cc09a6 commit 4966a71
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion addons/links/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ Have a look at the linkTo function:
import { linkTo } from '@storybook/addon-links'

linkTo('Toggle', 'off')
linkTo(() => 'Toggle', () => 'off')
linkTo('Toggle') // Links to the first story in the 'Toggle' kind
```

With that, you can link an event in a component to any story in the Storybook.

- First parameter is the the story kind name (what you named with `storiesOf`).
- Second parameter is the story name (what you named with `.add`).
-   Second (optional) parameter is the story name (what you named with `.add`). If the second parameter is omitted, the link will point to the first story in the given kind.

> You can also pass a function instead for any of above parameter. That function accepts arguments emitted by the event and it should return a string. <br/>
> Have a look at [PR86](https://github.com/kadirahq/react-storybook/pull/86) for more information.

0 comments on commit 4966a71

Please sign in to comment.