Skip to content
Skip to content
Goodspeed

Build apps with React Hook Form

React Hook Form manages all generated forms: typed useTypedForm hook, server error propagation, and async field validation. Goodspeed generates React Hook Form as a standard part of every app, so the output is a working codebase from day one, not a scaffold you have to finish yourself.

WHAT GETS GENERATED

Built into every React Hook Form build

Every app Goodspeed generates with React Hook Form includes these production-ready patterns, wired together from the first build.

ItemDescriptionStrength
useTypedForm<T> hook in lib/forms.tsA typed wrapper around useForm with zodV4Resolver pre-wired. Mode defaults to onBlur to reduce re-renders on mobile keyboards.Hook
useFormServerError hookReads and sets root.serverError from the RHF error state, giving server-side validation messages the same display path as client-side ones.Hook
useAsyncFieldValidator hookA debounced async validator (300ms default) for fields that need server-side uniqueness checks, like username availability.Hook
components/forms/ typed form primitivesFormField, FormInput, FormSelect, and FormError wrap React Hook Form controllers in NativeWind-styled components that handle label, placeholder, and error display.Components

Source: gas-template repository · Form State Management

REAL GENERATED CODE

A snippet from a React Hook Form app the studio shipped

This pattern comes directly from the gas-template codebase, the foundation every Goodspeed app is generated on. The studio generates React Hook Form code like this for every app in the pipeline, not just a hello-world scaffold.

  1. useTypedForm

    // lib/forms.ts: typed RHF wrapper
    export function useTypedForm<T extends FieldValues>(
      schema: z.ZodType<T>,
      options?: Omit<Parameters<typeof useForm<T>>[0], 'resolver'>
    ): UseFormReturn<T> {
      return useForm<T>({
        resolver: zodV4Resolver(schema),
        mode: 'onBlur',
        ...options,
      });
    }
GDaily Allergens

Today's log

Gluten
Tree nuts
Shellfish
Dairy
HomeScanLogProfile

START WITH REACT HOOK FORM

Your React Hook Form app, generated