diff --git a/lib/components/FormComponentSlots.tsx b/lib/components/FormComponentSlots.tsx index 192f24f..2476f11 100644 --- a/lib/components/FormComponentSlots.tsx +++ b/lib/components/FormComponentSlots.tsx @@ -46,12 +46,15 @@ const FormComponentSlots = memo( } = props.preference; // Memoize all components - const byType = useMemo(() => _byType, []); - const byFormType = useMemo(() => _byFormType, []); - const byProperty = useMemo(() => _byProperty, []); - const byCustomType = useMemo(() => _byCustomType, []); - const byCustomControlType = useMemo(() => _byCustomControlType, []); - const byLayoutName = useMemo(() => _byLayoutName, []); + const byType = useMemo(() => _byType, [_byType]); + const byFormType = useMemo(() => _byFormType, [_byFormType]); + const byProperty = useMemo(() => _byProperty, [_byProperty]); + const byCustomType = useMemo(() => _byCustomType, [_byCustomType]); + const byCustomControlType = useMemo( + () => _byCustomControlType, + [_byCustomControlType], + ); + const byLayoutName = useMemo(() => _byLayoutName, [_byLayoutName]); // Hierarchical order of precedence for component lookup: // 1. formComponentsByProperty diff --git a/lib/simple_form/context_component.tsx b/lib/simple_form/context_component.tsx index 47014bc..20570c4 100644 --- a/lib/simple_form/context_component.tsx +++ b/lib/simple_form/context_component.tsx @@ -8,7 +8,7 @@ export function SimpleForm({ onChange, onEvent, value, -}: Omit, "getValue" | "setValue"> & { +}: Omit, "getValue" | "setValue" | "dispatch"> & { onEvent?: (name: string, payload: unknown) => void; children: ReactNode; }) {