0.1.1 • Published 3 years ago
@code-is-key/reform v0.1.1
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
3 years ago
0.0.11
3 years ago
0.0.12
3 years ago
0.0.13
3 years ago
0.0.14
3 years ago
0.1.0
3 years ago
0.1.1
3 years ago
0.0.15
3 years ago
0.0.9
3 years ago
0.0.16
3 years ago
0.0.8
3 years ago
0.0.17
3 years ago
0.0.5
3 years ago
0.0.4
3 years ago
0.0.7
3 years ago
0.0.6
3 years ago
0.0.3
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago