Why can't I change my input value in React even with the onChange listener

前端 未结 6 1202
再見小時候
再見小時候 2021-02-05 00:20

I am quite new to React and after going through some tutorials, I was trying the below code of mine.

I made one component, passed props to it from a store, on compo

6条回答
  •  清歌不尽
    2021-02-05 00:34

    You can do shortcut via inline function if you want to simply change the state variable without declaring a new function at top:

     this.setState({ text: e.target.value })}/>
    

提交回复
热议问题