-
-
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
Fix for types number
for addon knobs
#1001
Conversation
@@ -25,7 +25,9 @@ stories.add('with all knobs', () => { | |||
const dob = date('DOB', new Date('January 20 1887')); | |||
|
|||
const bold = boolean('Bold', false); | |||
const color = color('Color', 'black'); | |||
const selectedColor = color('Color', 'black'); |
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.
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 625 Continue to review full report at Codecov.
|
Thank you for this @marcfallows ! Maybe you can help us get even more typescript support? |
number
number
for addon knobs
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 7620861. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
Issue:
number
did 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.