Form Component

The form component is a wrapper around the form library. It manages form state and is responsible submitting the form once all the fields are valid.

Internally the Form component creates an instance of new FormState() which extends Selectable from the selkt library.

import { Form, useCreateForm } from "@snsw-forms/form" function MyApp() {  const formState = useCreateForm({ name: "" })  return (    <Form connect={formState} onSubmit={alert}>      <Label prop="name" label="Name">        <Input type="name" placeholder="John Snow" />      </Label>      <Submit />      <Log />    </Form>  )} render(MyApp)
Loading...