Preliminary Learning of React - Building a Personal Blog with React

Preliminary Learning of React - Building a Personal Blog with React

I wrote a very simple personal blog with React and Webpack, mainly to get familiar with the use of various basic properties and methods in react. I encountered a lot of problems during the construction process. By reading the official API , I have a better understanding of the life cycle and status improvement of react.

  1. build tool webpack
  2. css compilation using css-loader
  3. Blog source code [email protected] :sunrun93/react-blog-app.git

  4. Download the source code locally, install dependencies through npm i, and run the project with npm start
  5. After the dependencies are installed, you must find the css-loader configuration in the node_modules\react-scripts\config\webpack.config.dev.js and node_modules\react-scripts\config\webpack.config.prod.js files, and check the options Make corresponding modifications, add the following two lines, and enable css-modules.

      {
      loader: require.resolve('css-loader'),
      options: {
        ......
        modules: true, 
        localIdentName: '[name]__[local]__[hash:base64:5]'
      },
       },

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325473032&siteId=291194637