Skip to content

️ deps: Bump react-hook-form from 7.23.0 to 7.25.1

Yogi Bot requested to merge dependabot-npm_and_yarn-react-hook-form-7.25.1 into main

Bumps react-hook-form from 7.23.0 to 7.25.1.

Release notes

Sourced from react-hook-form's releases.

Version 7.25.1

🐞 fix #7662 issue with reset file input (#7656) 🚗 improve perf with get proxy formState (#7655) 🏋️ remove redundant check (#7651) 🐞 fix #7648 Unable to setFocus to Controller after reset (#7649) 🐞 fix: getFieldState - error might be undefined (#7636) improve useFieldArray code consistency (#7628)

thanks to @​Moshyfawn and @​michalbundyra

Version 7.25.0

new getFieldState API: get individual field state

Documentation: https://react-hook-form.com/api/useform/getfieldstate

import * as React from "react";
import { useForm } from "react-hook-form";
export default function App() {
const {
register,
getFieldState,
formState: { isDirty, isValid }
} = useForm({
mode: "onChange",
defaultValues: {
firstName: ""
}
});
// you can invoke before render or within the render function
const fieldState = getFieldState("firstName");
return (
<form>
<input {...register("firstName", { required: true })} />
<p>{getFieldState("firstName").isDirty && "dirty"}</p>
<p>{getFieldState("firstName").isTouched && "touched"}</p>
<button type="button" onClick={() => console.log(getFieldState("firstName"))}>
field state
</button>
</form>
);
}

Version 7.24.2

😰 close #7593 regression on fieldarray controller/useController unmount with unregister (#7596) 🥸 fix type issue with getFieldState and useController (#7574)

... (truncated)

Changelog

Sourced from react-hook-form's changelog.

Changelog

[7.24.0] - 2022-1-14

  • useController return prop: onChange, onBlur and ref will be memorized with useCallback
Commits

Merge request reports

Loading