Skip to content
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 PropTypes in addons/knobs NumberType #4669

Merged
merged 3 commits into from
Nov 5, 2018

Conversation

tarikhamilton
Copy link
Contributor

If knob.value is null or undefined, it gets converted to a string, but the PropTypes did not reflect this.

Issue:

What I did

Updated NumberType.propTypes in addon/knobs to allow strings so errors aren't thrown when clearing the number input (necessary if you'd like to pass null to a prop, see: 85e4955).

How to test

Erase the number in the input field and you should get a PropTypes error.

Is this testable with Jest or Chromatic screenshots? No.
Does this need a new example in the kitchen sink apps? No.
Does this need an update to the documentation? No.

If knob.value is null or undefined, it gets converted to a string, but the PropTypes did not reflect this.
@Hypnosphi Hypnosphi added bug addon: knobs patch:yes Bugfix & documentation PR that need to be picked to main branch labels Nov 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: knobs bug patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants