react Remarks

1. React this binding assembly

Since this is not point in JSX current object, so the need tobind

Reference article:

2. controlled and non-controlled assembly components

in short,

  • The controlled components
    for example, each time it will change state corresponding to a value


    6224960-877c6954f61b6c79.png
  • Uncontrolled
    us usually written in a form similar to the real data is stored in the DOM node, only when submitted, will get the value of the form
  • How to choose?
    According to their project requirements, personal understanding is, if you want to do real-time verification, then it is a controlled components;
    If the form is relatively simple, then it is a non-controlled components, relatively speaking, reducing the amount of code related onChange.

Reference article:

Guess you like

Origin blog.csdn.net/weixin_33787529/article/details/90958754