react-formstate-fp
v1.3.1
Published
An API to build, query, update, and bind formstate in React. Develop forms DRYly in React.
Downloads
26
Maintainers
Readme
react-formstate-fp
An API to build, query, update, and bind formstate in React.
It's glue for your forms
With react-formstate-fp, and your choice of input components, you can assemble forms DRYly in React.
It solves the right problem to solve for React forms
By focusing on your form's data, and keeping you in control of your form's behavior, react-formstate-fp eliminates the busy work involved with React forms, without limiting you or getting in your way.
Setup
npm install --save react-formstate-fp
Demo
All examples demonstrated here.
Examples and documentation
- Basic example
- Typescript example
- How is this better than raw React?
- Why the departure from react-formstate?
- Initialization
- Binding inputs to formstate
- Synchronous validation
- Asynchronous validation
- Submitting
- Change and blur handlers
- Nested forms
- Arrays, addModelKey, deleteModelKey
- Quirks and edge cases
- useFormstate and bindToSetStateComponent
- API index
Dependencies
- A peer dependency on React >= 16.8 (React hooks).
- @babel/runtime might be pulled in depending on how you build your project.
Basically no dependencies other than React.
Environment
- Assumes an es5 environment (for example: Object.keys and Array.isArray).
- Assumes es6 promises. (This is the only polyfill requirement beyond es5.)
- Works with Typescript.
Thanks for your interest!