s-private API Documentation - v3.8.1
    Preparing search index...

    Function useFormValues

    • Hook to access form values from the GenericFormWrapper context.

      Returns Record<string, string>

      Record of field names to their preserved values

      Use this hook in form field components to access preserved form values when a form submission fails and values need to be restored.

      function MyFormField({ name }) {
      const formValues = useFormValues();
      const preservedValue = formValues[name];
      return <input defaultValue={preservedValue} name={name} />;
      }

      GenericFormWrapper for the provider component