React: trigger onChange if input value is changing by state?

后端 未结 9 1917
我在风中等你
我在风中等你 2020-11-30 04:34

Edit: I don\'t want to call handleChange only if the button has been clicked. It has nothing to do with handleClick. I gave an example in the @shubhakhatri

9条回答
  •  死守一世寂寞
    2020-11-30 05:02

    I know what you mean, you want to trigger handleChange by click button.

    But modify state value will not trigger onChange event, because onChange event is a form element event.

提交回复
热议问题