- fix a bug with
getValues()
which data formate forarray
data is incorrect
Example below:
function App() {
const { register, getValues } = useForm({
defaultValues: { test: [0, 1] }
});
console.log(getValues()); // { test: [0, 1]}
return (
<form>
<input name="test[0]" ref={register} type="checkbox" />
<input name="test[1]" ref={register} type="checkbox" />
</form>
);
}