From 019218998c032ac0a30f1b10ba85a0aa35ca8a76 Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Mon, 4 Sep 2017 21:06:06 +1000 Subject: [PATCH 1/2] docs: linkTo The linkTo docs are incomplete, references https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19499 --- addons/links/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/links/README.md b/addons/links/README.md index 1e22966e1b50..5a5a4d6b20f8 100644 --- a/addons/links/README.md +++ b/addons/links/README.md @@ -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 linj 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.
> Have a look at [PR86](https://github.com/kadirahq/react-storybook/pull/86) for more information. From eb7af6e0c9e7c44f22b0b585466af0223553b7d8 Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Mon, 4 Sep 2017 21:06:56 +1000 Subject: [PATCH 2/2] Update README.md --- addons/links/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/links/README.md b/addons/links/README.md index 5a5a4d6b20f8..9c34458a53cb 100644 --- a/addons/links/README.md +++ b/addons/links/README.md @@ -43,7 +43,7 @@ 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 (optional) parameter is the story name (what you named with `.add`). If the second parameter is omitted, the linj will point to the first story in the given kind. +-   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.
> Have a look at [PR86](https://github.com/kadirahq/react-storybook/pull/86) for more information.