Fix for types number for addon knobs#1001
Merged
ndelangen merged 3 commits intostorybookjs:masterfrom May 9, 2017
Merged
Conversation
marcfallows
commented
May 8, 2017
|
|
||
| const bold = boolean('Bold', false); | ||
| const color = color('Color', 'black'); | ||
| const selectedColor = color('Color', 'black'); |
Contributor
Author
There was a problem hiding this comment.
This is changed because TS should complain about block scoping when trying to override color. Updated to use a different name (which lines up with the storybook example).
Codecov Report
@@ Coverage Diff @@
## master #1001 +/- ##
=======================================
Coverage 12.61% 12.61%
=======================================
Files 192 192
Lines 4424 4424
Branches 707 707
=======================================
Hits 558 558
Misses 3241 3241
Partials 625 625Continue to review full report at Codecov.
|
ndelangen
approved these changes
May 9, 2017
Member
|
Thank you for this @marcfallows ! Maybe you can help us get even more typescript support? |
numbernumber for addon knobs
|
View your CI Pipeline Execution ↗ for commit 7620861.
☁️ Nx Cloud last updated this comment at |
Closed
8 tasks
8 tasks
8 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue:
numberdid not have the correct types to allow for passing options in typescript.What I did
I added the types, and updated the typescript example (which wasn't using
number).How to test
Typescript does not complain about
packages/addon-knobs/example/typescript/index.tsx. If you only use the first commit you'll see it breakhttps://github.com/marcfallows/storybook/commit/07ddee747e839f0e93ffc010a479d94bc9b6c9c5 and then it is fixed on marcfallows@378acbc.