Call 2 functions within onChange event

后端 未结 3 462
忘了有多久
忘了有多久 2021-01-31 03:50

I\'m a bit stuck with my component, I need to call onChange from props so


         


        
3条回答
  •  旧时难觅i
    2021-01-31 04:23

    function(e) {this.props.onChange(e); this.handleChange(e)}.bind(this)

    You might not need .bind(this), but I suspect you will.

    This will create a new function on each render, so it'd be better in certain respects to have that function be a component method, but this should work.

提交回复
热议问题