commit a84c0f8e8b85036961ee8227c2326bf7afddf85f
parent e2d51b817edd8e1ccd0cd11f034ae224cbea428d
Author: Sebastian <sebasjm@taler-systems.com>
Date: Wed, 22 Jul 2026 14:44:30 -0300
again, rules of hooks broken
Diffstat:
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/packages/web-util/src/hooks/useForm.ts b/packages/web-util/src/hooks/useForm.ts
@@ -146,13 +146,14 @@ export function useFormMeta<T>(
formContext: any,
initialValue: RecursivePartial<FormValues<T>>,
): FormState<T> {
- let formDesign: FormDesign;
- if (typeof form.config === "function") {
- const config = form.config;
- formDesign = useMemo(() => config(formContext), [form, formContext]);
- } else {
- formDesign = form.config;
- }
+ let formDesign: FormDesign = useMemo(() => {
+ if (typeof form.config === "function") {
+ const config = form.config;
+ return config(formContext);
+ } else {
+ return form.config;
+ }
+ }, [form, formContext]);
return useForm(formDesign, initialValue);
}