How to package and optimize react projects
1. View packaging commands
2. Run the package command
My is ` npm run build`
3. Project packaging and Optimization - Project local Preview
Objective: to be able to preview the packaged project locally
Steps:
1. Global installation of local service package: npm i -g serve. This package provides the serve command to start t ...
Added by bigrossco on Mon, 22 Nov 2021 09:58:37 +0200
Have you mastered the basic use of React?
Have you mastered the basic use of React?
Basic Use - Common, Must Be
Advanced Features - Not Common, but Depth. Next article will review React Advanced Features
Hooks - Common, must, shared the basics before [ React Hooks Basic Usage Details]
Use of Redux and React-router, and subsequent articles will also cover [Redux and React-router use ...
Added by pwicks on Sun, 21 Nov 2021 03:23:04 +0200
JS function advanced (including some written test questions of closure, anti shake and throttling)
1. callback function
Asynchronous: when doing an operation, you can do other things Synchronization: when doing an operation, others can only wait for alert for //-Asynchronous: when doing an operation, you can do other things timer
console.log(1);
setTimeout(function () { console.log("timer"); }, 2000);
console.log(2);
// ...
Added by drunknbass on Fri, 19 Nov 2021 18:22:04 +0200
Installation and use of React
1, React library description
The react library consists of two parts: 1. React contains all basic functions; 2. ReactDOM only contains the function of operating DOM.
1. Load React Library
# 1. Load with < script >
Development version:<script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>
R ...
Added by nishmgopal on Thu, 18 Nov 2021 01:41:55 +0200
Preparations for the launch of React project
1, Create project
Using React CLI to build a project: NPX create react app geek PC Enter the project root directory: CD geek PC Start project: npm run start Adjust the project directory structure:
/src / assets # Project resource files, such as, pictures, etc / components # Ge ...
Added by flhtc on Wed, 17 Nov 2021 15:00:00 +0200
React_day04_react routing, communication between components, news website construction
1. Issues related to version compatibility
It was another pit mining process that was inconsistent with the tutorial version, and it also wasted a lot of twists and turns. In actual development, React17, react DOM router 6. X, antd 4.x Tutorial version React16, react DOM router 5. X, antd 3.x At first, I wanted to install a new version to solv ...
Added by naboth_abaho on Wed, 17 Nov 2021 11:12:34 +0200
React's understanding of setState synchronization or asynchrony
1. setState synchronization? Asynchronous?
In the class component of React, we can use the setState method to update the state. But sometimes you can't get the latest data after using setState.
In fact, the execution process and code of setState in React are synchronized, which is only caused by the performance optimization mechanism of React ...
Added by newman on Tue, 09 Nov 2021 11:42:31 +0200
[micro front end] take you to realize the access of a React sub application from scratch
preface
Hello, guys. Today, I will continue to share with you the relevant knowledge about qiankun, a micro front-end. In the previous article, we have implemented a simple micro front-end application based on qiankun+vue2.0, and also realized the switching of history and hash routing modes. In this application, both the main application an ...
Added by php_man555 on Sat, 06 Nov 2021 15:43:28 +0200
stylelint access practice pit summary
prefaceDuring team cooperation, when everyone's code has a custom formatting method, many conflicts often need to be solved when submitting the merge. At this time, we can use eslint+stylelint to restrict the team's code. The introduction of eslint configuration is relatively simple. There are many tutorials on the Internet, while most of the s ...
Added by Altec on Sat, 06 Nov 2021 05:40:00 +0200
react type limits props
Undertake the above
<body>
<div id="test1"></div>
<div id="test2"></div>
<!-- Import core library -->
<script src="../js/react.development.js"></script>
<!-- expanded memory bank -->
<script src="../js/react-dom.development.js"></script>
<!-- tran ...
Added by weyes1 on Thu, 04 Nov 2021 13:53:39 +0200