[React log] 05-The use of props in React (from parent to child)

1: Preparation

Parent component (APP) Child component (Header)

Rewrite APP content in index.js1

2: Description of data transfer

2

3: Back to the child component (Header.js)

Insert picture description here

4: If you debug and see props go back to the transmission of new data in index.js ps: useage is not userage, one less r

4

5: If you check back to the content of the red box in Header.js and re-run it, you can view the result in the browser

5

6: The results are as follows

6

Guess you like

Origin blog.csdn.net/u013034585/article/details/105822266