react-input-mask
react-input-mask copied to clipboard
InputMask contains an input of type undefined with both value and defaultValue props.
When implementing the component, show this error.
Warning: InputMask contains an input of type undefined with both value and defaultValue props. Input elements must be either
controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled
or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components
<InputMask
{...leftover}
mask={'99'}
disabled={true}
value={leftover.value || ''}
defaultValue={leftover.defaultValue || ''}
className={`input-time-text input-time ${disabledClass}`}
/>
I'm using Formik + react-input-mask and my case missed including the field "initialValues={{". Example: < Formik innerRef={formikRef} initialValues={{ phone: '', }} My field looks like this: