REACT goes from getting started to building projects

1. Start with official documents

Personally, I like the style of this document, no nonsense!! Follow the document to the inside of the game to write down the basic OK

react.docschina.org/

React-router-dom and react-loadable

React does not provide routing modules, unlike Angular, which does everything for you, so use the wisdom of the crowd. React-router-dom is one of the most widely used versions of router for web development. If you are interested in react-router-dom for web development, please visit the official website for more information.

  • The installation package

npm i react-router-dom -D

npm i react-loadable -D

  • The configuration is as follows:

    • Create a route folder in SRC and create a new file named routes.js as follows:

    • Note that the LoadingComponent is the loading animation component

    • Load on demand I use a package called react-loadable. The core of this package is import(). Route to that page and load that page

3. Fetch

  • The installation package

npm install fetch --D

  • Create a new HTTP folder in the SRC directory and create a new file called fetch. Js as follows

4. Integrate THE UI framework (Ant ant)

  • The installation package

npm install antd

  • The official website is very clear, need to consult, friendship tips: just look at this

Ant. The design/docs/react /…