1.0.1 • Published 3 years ago

@jswork/mixin-react-on-change v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

mixin-react-on-change

OnChange mixin for react.

installation

npm install -S @jswork/mixin-react-on-change

bugs

  • state when formData.xx_field

usage

// create file in: mixins/on-change.js
export default require('@jswork/mixin-react-on-change').default(nx.$app);


// <input onChange={this.onChangeToState.bind(this, 'user.nickname')}>
// <input onChange={this.onChangeToState.bind(this, 'user.phone')}>

// state:
{
  user:{
    nickname:'',
    phone:''
  }
}