1.0.2 • Published 7 years ago

react-input-element v1.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

react-input-element

Just like a normal element except it fires onChange and onBlur with the input value rather than the event.

try it out on codepen

import React from 'react'
import { render } from 'react-dom'

import Input from 'react-input-element'

class Simple extends React.Component {
  constructor (props) {
    super(props)
    this.state = {
      value: ''
    }
  }
  render () {
    return (
      <Input 
        value={this.state.value} 
        onChange={value => this.setState({value})}
      />
    )
  }
}