ReactJS - 'valueLink' is deprecated set `value` and `onChange` instead

前端 未结 3 938
甜味超标
甜味超标 2021-02-10 13:50

I am currently learning ReactJS following a tutorial by the excellent Wes Bos, however I have reached a section regarding 2 way data binding and it seems the method Wes is teach

3条回答
  •  无人共我
    2021-02-10 14:22

    Yeah, the tutorial is for an older version of ReactJS because ReactLink is deprecated.

    The recommendation is that you use the onChange event handler to set the state value:

    
    

    Basically, you have to create a method called onInputChange() and handle the change there.

    This is just for reference, in the end, you should probably just refer to a newer tutorial. I recommend this one.

提交回复
热议问题