@ied/react-enhanced-form

    1.5.1 • Public • Published

    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>
     )
    }

    Install

    npm i @ied/react-enhanced-form

    DownloadsWeekly Downloads

    4

    Version

    1.5.1

    License

    MIT

    Last publish

    Collaborators