We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82fe578 commit 85979f3Copy full SHA for 85979f3
src/components/FormContext.tsx
@@ -35,8 +35,14 @@ export const FormContext: FC<FormContextProps> = props => {
35
submitFocusError: submitFocusError,
36
})
37
38
- if (typeof onChange === 'function') {
39
- onChange(getObjectFromForm(props.schema, methods.watch()))
+ const isFirstRender = React.useRef(true)
+
40
+ const watchedInputs = methods.watch()
41
42
+ if (isFirstRender.current === true) {
43
+ isFirstRender.current = false
44
+ } else if (typeof onChange === 'function') {
45
+ onChange(getObjectFromForm(props.schema, watchedInputs))
46
}
47
48
const idMap = useMemo(() => getIdSchemaPairs(props.schema), [props.schema])
0 commit comments