MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / updateFormState

Function updateFormState

packages/core/src/forms/useForm.ts:58–69  ·  view source on GitHub ↗
(
    nextState: FormState<T> | ((prev: FormState<T>) => FormState<T>),
  )

Source from the content-addressed store, hash-verified

56 const fieldArrayKeyCounterRef = ctx.useRef<number>(0);
57
58 const updateFormState = (
59 nextState: FormState<T> | ((prev: FormState<T>) => FormState<T>),
60 ): void => {
61 setState((prev) => {
62 const resolved =
63 typeof nextState === "function"
64 ? (nextState as (prev: FormState<T>) => FormState<T>)(prev)
65 : nextState;
66 stateRef.current = resolved;
67 return resolved;
68 });
69 };
70
71 const wizardSteps = options.wizard?.steps ?? [];
72 const stepCount = wizardSteps.length;

Callers 1

useFormFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected