React Philosophy: Functional philosophy

** A, ** installation

Global installation

yarn global add create-react-app

Enter folder

use

The create – react – app project name

Enter the directory

CD XXX Run the yarn start command to start the project

Second, the virtual DOM and Diff algorithm of small understanding

Virtual DOM: An object that represents a div instead of the DIV DOM. Modifying the object is faster than modifying the DOM directly.

DOM Diff algorithm: The DOM Diff algorithm is used to compare two DOM and find the difference.

Three, the use of JSX notes:

1. Class should be className

2. All the js code needs to be wrapped in {}

{{id:1}} {{id:1}}

4. return( … )