0.15.4 • Published 8 months ago
@seegno/react-forms v0.15.4
Seegno React Forms
Manage React form state the easy way and validate with json-schema.
Installation
yarn add @seegno/react-formsMake sure you have at least version 16.8 of React:
yarn add react@^16.8.0Usage
import { FormProvider, useField } from '@seegno/react-forms';
function Input({ name }) {
const { onChange, value } = useField(name);
return (
<input
name={name}
onChange={event => onChange(event.target.value)}
value={value}
/>
);
}
function Form() {
return (
<FormProvider
jsonSchema={{
properties: {
foo: { type: 'string' }
},
type: 'object'
}}
onSubmit={values => console.log('submit', values)}
>
{({ submit }) => (
<form onSubmit={submit}>
<Input name={'foo'} />
<button type={'submit'}>
{'Submit'}
</button>
</form>
)}
</FormProvider>
);
}Tests
Run the tests from the root directory:
yarn testContributing & Development
Contributing
Found a bug or want to suggest something? Take a look first on the current and closed issues. If it is something new, please submit an issue.
Develop
It will be awesome if you can help us evolve @seegno/react-forms.
Want to help?
- Fork it.
- Install the dependencies with
yarn. - Hack away.
- Run the tests:
yarn test. - Create a Pull Request.
0.15.4
8 months ago
0.15.1
9 months ago
0.15.2
9 months ago
0.15.3
9 months ago
0.15.0
3 years ago
0.14.0
4 years ago
0.13.0
4 years ago
0.13.1
4 years ago
0.12.0
5 years ago
0.11.0
5 years ago
0.10.3
5 years ago
0.10.2
5 years ago
0.10.1
5 years ago
0.10.0
5 years ago
0.9.0
5 years ago
0.8.0
6 years ago
0.7.0
6 years ago
0.6.0
6 years ago
0.5.0
6 years ago
0.4.0
6 years ago
0.3.0
6 years ago
0.2.0
6 years ago
0.1.2
6 years ago