The best react form component, on earth 🌍
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs webpack updated Oct 17, 2017
example
lib
src
webpack
.babelrc
.eslintignore
.eslintrc Add sample Apr 14, 2017
.gitignore
.npmignore v1.4.0 Apr 15, 2017
README.md
package.json v1.5.1 Oct 18, 2017
yarn.lock Update package.json Oct 18, 2017

README.md

Live

Show-room

react-enhanced-form

Usage

yarn add react-enhanced-form
import React from 'react'
import Input from 'react-enhanced-form'

class Main extends React.Component {

  style = {
    default: { width: 300 },
    onFocus: { borderBottom: '1px solid green' },
    onError: { borderBottom: '1px solid red' }
  }

  check = newValue => newValue < 10
  format = value => `${value} $`

  render = () => (
    <form onSubmit={this.handleSubmit}>
      <Input
        type='number'
        value='1'
        onChange={(data, error) => console.log('change', data, error)}
        onMount={(data,error) => console.log('mount', data, error)}
        style={this.style}
        check={this.check}
        format={this.format}
        required
      />
    </form>
 )
}