Replies: 2 comments 2 replies
-
Strangely, I replaced with from Cleave.js and the error disappears now.
Still would like to understand why it didn't work for ? I thought Cleve.js is just a wrapper of , essentially they are the same? |
Beta Was this translation helpful? Give feedback.
0 replies
-
@RoosterH the warning is actually saying that there is no // pull validate out of props passed to `input`
const CreditCardField = ({ label, validate, ...props }) => {
// and add it back to `useField`
const [field, meta, helpers] = useField({ ...props, validate });
return <input {...field} {...props} />
}; |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am following the Doc to create a useField() https://formik.org/docs/api/useField.
Code snippet:
Field successfully shows up with credit card number masked. However, I got an error "Warning: Invalid value for prop
validate
on tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. "According to this Doc, https://formik.org/docs/api/useField#fieldhookconfigvalue. "validate" is part of FieldHookConfig just like "name" and "type". Why doesn't it work?
Beta Was this translation helpful? Give feedback.
All reactions