npm react-hook-form 7.9.0
Version 7.9.0

latest releases: 7.51.3, 7.51.2, 7.51.1...
2 years ago

🥇 feature: support browser native form control (#5503)

Screen Shot 2021-06-19 at 10 26 37 am

export default function App() {
  const { register, handleSubmit } = useForm({
    shouldUseNativeValidation: true,
  });
  const onSubmit = (data) => console.log(data);

  return (
    <form onSubmit={handleSubmit(onSubmit)}>
      <input
        {...register("firstName", {
          required: "This is required from bill."
        })}
        autoComplete={"off"}
        placeholder="First Name"
      />
      <input type="submit" />
    </form>
  );
}

🐞 fix #5661 trigger throw error when the field is not found (#5664)
🐞 fix #5678 reset with keep default values with Controller (#5688)

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

NewReleases is sending notifications on new releases.