README
react-form
Easy React form with context and hook
Features
- Easy form components
- Auto disable on submit
- Multiple submit buttons support
- Nested attributes support
Installation
yarn install @swiftcarrot/react-form
# npm install @swiftcarrot/react-form --save
Quick start
import React from 'react';
import {
Form,
FormLabel,
FormControl,
FormError,
FormSubmit,
} from '@swiftcarrot/react-form';
function App() {
function handleSubmit(values) {
console.log(values);
}
return (
<Form onSubmit={handleSubmit}>
<FormLabel name="name">Name</FormLabel>
<FormControl name="name" />
<FormError name="name" />
<FormSubmit />
</Form>
);
}
License
MIT