react-hook-form 7.54.0 → 7.54.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/controller.d.ts +1 -1
- package/dist/controller.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.mjs +5 -7
- package/dist/index.esm.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/useForm.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.esm.mjs
CHANGED
@@ -633,7 +633,7 @@ function Form(props) {
|
|
633
633
|
headers && headers['Content-Type'],
|
634
634
|
encType,
|
635
635
|
].some((value) => value && value.includes('json'));
|
636
|
-
const response = await fetch(action, {
|
636
|
+
const response = await fetch(String(action), {
|
637
637
|
method,
|
638
638
|
headers: {
|
639
639
|
...headers,
|
@@ -2595,8 +2595,8 @@ function createFormControl(props = {}) {
|
|
2595
2595
|
* ```
|
2596
2596
|
*/
|
2597
2597
|
function useForm(props = {}) {
|
2598
|
-
const _formControl = React.useRef();
|
2599
|
-
const _values = React.useRef();
|
2598
|
+
const _formControl = React.useRef(undefined);
|
2599
|
+
const _values = React.useRef(undefined);
|
2600
2600
|
const [formState, updateFormState] = React.useState({
|
2601
2601
|
isDirty: false,
|
2602
2602
|
isValidating: false,
|
@@ -2674,10 +2674,8 @@ function useForm(props = {}) {
|
|
2674
2674
|
values: control._getWatch(),
|
2675
2675
|
});
|
2676
2676
|
}, [props.shouldUnregister, control]);
|
2677
|
-
|
2678
|
-
|
2679
|
-
formState: getProxyFormState(formState, control),
|
2680
|
-
}), [formState, control]);
|
2677
|
+
_formControl.current.formState = getProxyFormState(formState, control);
|
2678
|
+
return _formControl.current;
|
2681
2679
|
}
|
2682
2680
|
|
2683
2681
|
export { Controller, Form, FormProvider, appendErrors, get, set, useController, useFieldArray, useForm, useFormContext, useFormState, useWatch };
|