Closed duykhiem closed 5 years ago
Hi,
when you have null
value in your input and change it to something else, React will throw warning like
is changing an uncontrolled input of type text to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component
so you must define some empty value for your input in any case to avoid this, because this library assumes that all inputs are controlled.
state = {
defaultObject: {
title: '',
name: '',
}
}
Hi,
In mostly "add new screen", object's properties will be null. Without input anything, the text field have null value should still satisfy all maxStringLength validation.
Current code : https://github.com/NewOldMax/react-form-validator-core/blob/master/src/ValidationRules.jsx#L55
Can we update it to something like this :
Thank you and Best regards, /K