0.1.1 • Published 4 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
4 years ago
0.0.11
4 years ago
0.0.12
4 years ago
0.0.13
4 years ago
0.0.14
4 years ago
0.1.0
4 years ago
0.1.1
4 years ago
0.0.15
4 years ago
0.0.9
4 years ago
0.0.16
4 years ago
0.0.8
4 years ago
0.0.17
4 years ago
0.0.5
4 years ago
0.0.4
4 years ago
0.0.7
4 years ago
0.0.6
4 years ago
0.0.3
4 years ago
0.0.2
4 years ago
0.0.1
4 years ago