Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const EmailChipInput = ({ className, name, label, disabled }) => {
const {
fields,
meta: { error, active },
} = useFieldArray(name, { subscription: { error: true, active: true } });
const [value, setValue] = useState('');
const handleChange = useCallback(
event => {
event.preventDefault();
setValue(event.target.value);
},
[setValue]
);
const addToChips = useCallback(() => {
fields.push(value);
setValue('');
}, [value, fields, setValue]);