0.1.1 • Published 5 years ago

@code-is-key/reform v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

reForm

The only form validation library you will ever need!

Getting started

npm i @code-is-key/reform

Guide

reForm uses a yup object to validate the input of a form element. Pass in a FormState type to the hook that matches the inputs you want to connect.

reform uses the html name tag to automatically bind the input to the typecheck

interface FormState {
  email: string;
}

const Component: FC = () => {
  const { errors, values, onChange } = useForm<FormState>({ schema });

  return (
    <FormControl isInvalid={!!errors.email}>
      <FormLabel>Email</FormLabel>
      <Input name="email" type="email" onChange={onChange} value={values.email} />
      <FormErrorMessage>{errors.email}</FormErrorMessage>
    </FormControl>
  );
};
0.0.10

5 years ago

0.0.11

5 years ago

0.0.12

5 years ago

0.0.13

5 years ago

0.0.14

5 years ago

0.1.0

5 years ago

0.1.1

5 years ago

0.0.15

5 years ago

0.0.9

5 years ago

0.0.16

5 years ago

0.0.8

5 years ago

0.0.17

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago