@braces/react-form
    TypeScript icon, indicating that this package has built-in type declarations

    0.3.2 • Public • Published

    React Form

    npm Version

    This package is deprecate, Please check @braces/reform

    Install

    1 Install react form as dependency

    # Using yarn package manager
    $ yarn add @braces/react-form
    
    # Using npm package manager
    $ npm install --save @braces/react-form

    2 Import React form module

    // ES6
    import { Form } from "@braces/react-form"
    
    // ES5
    var Form = require("@braces/react-form").Form;

    Example

      import React from "react";
      import { Form, Field } from "@braces/react-form";
    
      export default (props) => {
        return (
          <Form onSubmit={(e, values) => console.log(values)} validateOn={1}>
            <Field name="test1" render={(props) => (
              <div>
                <input {...props.input} />
                <ul>
                  {props.errors.map((error, i) => <li key={i}>{error}</li>)}
                </ul>
              </div>
            )}
              validationRules={{
                required: true,
                maxLength: 10,
              }} />
            <Field name="test2" render={(props) => <input {...props.input} />} />
            <Field name="test3" render={(props) => <input {...props.input} />} />
            <button>Submit</button>
          </Form>
        );
      };

    Contributing!

    All contributions are super welcome!

    License

    React Form is MIT licensed.

    Install

    npm i @braces/react-form

    DownloadsWeekly Downloads

    12

    Version

    0.3.2

    License

    MIT

    Unpacked Size

    65.3 kB

    Total Files

    30

    Last publish

    Collaborators

    • hafeez1042