Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-form-data-handler

donyariesta4MIT1.0.6

Simplify your work at handling the form especially its data. no more headache for handling the state.

react-component, react, package, react, form, input, form-data, form-data-state

readme

react-form-data-handler

Simplify your work at handling the form-data. no more headache for managing the state.

Install

npm install react-form-data-handler

Usage


import React, { Component } from 'react';
import Form from 'react-form-data-handler';

class Test extends Component{
    submit(e){
        e.preventDefault();
        // you can get the form data by accessing class state "this.state.input"
    }

    render(){
        return(

            <Form
                onSubmit={this.submit.bind(this)} // binding a submit function
                stateSetter={(input) => {this.setState({input})}} // needed to set your state
            >
                /*
                * write all your input field components here..
                * example <input type="text" defaultValue="john doe" name="fullname" />
                */
            </Form>
        );
    }
}

License

MIT © Dony Ariesta