NumberInput: Initial value cannot be empty string due to PropTypes #4996
Labels
component: number-input
severity: 4
https://ibm.biz/carbon-severity
status: help wanted 👐
type: bug 🐛
NumberInput: Initial value cannot be empty string due to PropTypes
What package(s) are you using?
carbon-components
carbon-components-react
Detailed description
PropTypes for both value and defaultValue are set to Number so you cannot have it's initial value as an empty string despite the allowEmpty property. The following is logged to the console:
Warning: Failed prop type: Invalid prop
valueof type
stringsupplied to 'NumberInput', expected 'number'.
Additional information
https://codesandbox.io/s/pensive-dhawan-wh9vs
The text was updated successfully, but these errors were encountered: