Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
guillobits committed Dec 11, 2024
1 parent 67882f4 commit 492090a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"react-countup": "^4.3.3",
"react-dom": "^19.0.0",
"react-hook": "^0.0.1",
"react-hook-form": "^7.45.2",
"react-hook-form": "^7.54.0",
"react-image-file-resizer": "^0.3.8",
"react-lite-youtube-embed": "^2.2.0",
"react-modal": "^3.14.4",
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/components/forms/FormWithValidation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export function FormWithValidation<S extends FormSchema<AnyCantFix>>({
const { handleSubmit, control, reset, getValues, resetField, watch } =
useForm<ExtractFormSchemaValidation<S>>({
defaultValues,
shouldUnregister: true,
});

useImperativeHandle(innerRef, () => {
Expand Down
4 changes: 3 additions & 1 deletion src/components/forms/fields/GenericField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function GenericField<S extends FormSchema<AnyCantFix>>({
},
});

watch();
const allWatch = watch();

const onChangeCustom = useCallback(
(updatedValue) => {
Expand Down Expand Up @@ -165,6 +165,7 @@ export function GenericField<S extends FormSchema<AnyCantFix>>({
showLabel: field.showLabel,
showOptional: field.showOptional,
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [
field,
error,
Expand All @@ -175,6 +176,7 @@ export function GenericField<S extends FormSchema<AnyCantFix>>({
onChangeCustom,
ref,
value,
allWatch,
]);

if (field.component === 'datepicker') {
Expand Down

0 comments on commit 492090a

Please sign in to comment.