-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve linkTo documentation #1793
Conversation
The linkTo docs are incomplete, references DefinitelyTyped/DefinitelyTyped#19499
Codecov Report
@@ Coverage Diff @@
## master #1793 +/- ##
=======================================
Coverage 21.14% 21.14%
=======================================
Files 252 252
Lines 5693 5693
Branches 687 697 +10
=======================================
Hits 1204 1204
+ Misses 3969 3938 -31
- Partials 520 551 +31
Continue to review full report at Codecov.
|
@@ -36,12 +36,14 @@ Have a look at the linkTo function: | |||
import { linkTo } from '@storybook/addon-links' | |||
|
|||
linkTo('Toggle', 'off') | |||
linkTo(() => 'Toggle', () => 'off') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand this example, what does this do?
It's the exact same as above - it was introduced in the PR mentioned in the
README, but never formally written down. Basically a callback-based link.
…On 5 Sep. 2017 06:28, "Norbert de Langen" ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In addons/links/README.md
<#1793 (comment)>:
> @@ -36,12 +36,14 @@ Have a look at the linkTo function:
import { linkTo } from ***@***.***/addon-links'
linkTo('Toggle', 'off')
+linkTo(() => 'Toggle', () => 'off')
I do not understand this example, what does this do?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1793 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AALeho9Id6CYQy-kaVoEVBdN-9pivgWiks5sfF1VgaJpZM4PLxpr>
.
|
Interesting, TIL we have callback based linkTo 👍 |
@@ -36,12 +36,14 @@ Have a look at the linkTo function: | |||
import { linkTo } from '@storybook/addon-links' | |||
|
|||
linkTo('Toggle', 'off') | |||
linkTo(() => 'Toggle', () => 'off') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be?
linkTo((event) => 'Toggle', (event) => 'off')
The linkTo docs are incomplete, references DefinitelyTyped/DefinitelyTyped#19499