Skip to content

Write new docs for <Form> component #6

Description

@molovo

Need to update docs to highlight new features:

  • Uploading files now uses File objects with a server action
  • Server actions now receive a FormData object, instead of a basic object
  • onChange method added to allow callback to run when any value in the form changes
  • ref for <Form> component now returns a custom object instead of just the form element. Contains the following keys:
    // `DataStructure` is equivalent to `Yup.InferType<typeof schema>` and contains definitions for all values in the form
    
    form: HTMLFormElement
    submit: () => void
    reset: () => void
    values: WithRecaptcha<DataStructure>
    fields: {
      [P in DataStructure as string]?: HTMLElement
    }
    
  • FormRef type is now exported from @superrb/react-addons/src/components/form

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions