input counter #6824
mahdi81007
started this conversation in
Feature requests
input counter
#6824
Replies: 1 comment 2 replies
-
why dont you do simply something like this const [value, setValue] = useState('');
const handleChange = (e) => {
const inputValue = e.target.value;
setValue(inputValue);
if (inputValue.length === 10) {
console.error('count error');
}
};
return (
<input
type="text"
value={value}
onChange={handleChange}
/>
); |
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 want counter for length of input to set error for max or min length prop
Beta Was this translation helpful? Give feedback.
All reactions