[React log] 03-The first class component page

1: Prepare to install the es7 plug-in in VSCode and restart the compiler to take effect

figure 1

2: Create a new js file named header.js in src and use the shortcut rcc ps: rcc is a class component and rfc is a function component

figure 2

3: Use the header component in index.js

image 3

4: The transformation function APP component becomes a class component

Figure 4

5: After completion, remember to save and run the start command npm run start. Pay attention to whether the command is in the project directory and you can see the effect as follows

Figure 5

Guess you like

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