diff --git a/packages/react-form/src/createFormHook.tsx b/packages/react-form/src/createFormHook.tsx index 6a4140768..af0aa3973 100644 --- a/packages/react-form/src/createFormHook.tsx +++ b/packages/react-form/src/createFormHook.tsx @@ -270,15 +270,16 @@ export function createFormHook< const form = useForm(props) const AppForm = useMemo(() => { - return (({ children }) => { + const AppForm = (({ children }) => { return ( {children} ) }) as ComponentType + return AppForm }, [form]) const AppField = useMemo(() => { - return (({ children, ...props }) => { + const AppField = (({ children, ...props }) => { return ( {(field) => ( @@ -302,6 +303,7 @@ export function createFormHook< TSubmitMeta, TComponents > + return AppField }, [form]) const extendedForm = useMemo(() => { diff --git a/packages/react-form/src/useForm.tsx b/packages/react-form/src/useForm.tsx index 729064aba..639d44e16 100644 --- a/packages/react-form/src/useForm.tsx +++ b/packages/react-form/src/useForm.tsx @@ -193,7 +193,7 @@ export function useForm< extendedApi.Field = function APIField(props) { return } - extendedApi.Subscribe = (props: any) => { + extendedApi.Subscribe = function Subscribe(props: any) { return (