yarn react-hook-form 3.18.7
Version 3.18.7

latest releases: 7.53.2, 7.53.1, 7.53.0...
5 years ago
  • fix a bug with getValues() which data formate for array 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>
  );
}

Don't miss a new react-hook-form release

NewReleases is sending notifications on new releases.