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

InputMask contains an input of type undefined with both value and defaultValue props. #287

Open
jsnavarroc opened this issue May 7, 2022 · 1 comment

Comments

@jsnavarroc
Copy link

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}`}
   />
@ttasca
Copy link

ttasca commented Apr 17, 2023

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:

{({ field }) => ( )} in your case you would have to see the more complete code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants