React Base Form
A base form component for React applications
Install
npm install --save react-base-form validate.js
Note: validate.js it's a peer dependency
Usage
import React Component from "react";import BaseForm from "react-base-form"; const initialState = name: "Hello" email: "" extraInformation: dob: "" ;const validations = name: presence: allowEmpty: false "extraInformation.dob": presence: allowEmpty: false ; { event; if thisprops; }; { return <BaseForm = => onChange state errorsFor validate errors <div> <input = = /> <br /> <input ="email" = = /> <br /> <input ="date" = = /> <br /> <button =>Save</button> </div> </BaseForm> ; }
License
MIT © cherta