State management in React -- Redux
Let's take the function of adding to do list as an example:
In order to develop specifications, we should adopt the fragment writing method of reducer, that is, one type of data and one module
Write specifications without react Redux
Production and installation redux
yarn add redux
Create a store directory under the src ...
Added by mightymaster on Sun, 10 Oct 2021 06:45:55 +0300
Use React official Hooks instead of redux complete solution
redux as we all know, it is the react Management Library of the third party. It is difficult for many people to make complaints about it and has to use it. I recently found that most of the functions of redux can be implemented only with react official hooks! It is easier to use than redux, and the amount of code is less. I wrote a complete dem ...
Added by [PQ3]RogeR on Thu, 07 Oct 2021 03:00:37 +0300
React knowledge point recall
1, Components & props
1. Using props in function components
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Define character encoding -->
<meta charset="UTF-8">
<!-- introduce react Core library -->
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<!-- in ...
Added by Sakujou on Tue, 28 Sep 2021 07:53:10 +0300
One line command to update all npm dependent packages
npm packages are updated very quickly in order to update projects or global dependencies to the latest version. The traditional method is to update one by one, such as updating react to the latest version. The command is as follows:
# npm
npm i --save react@latest
# yarn
yarn add react@latest
Copy code
yarn is a new generation of js package ...
Added by Lerris on Mon, 27 Sep 2021 03:53:37 +0300
Missed unit tests of React components in those years
๐จโ๐พ Write in front
In the previous article, we have learned about the background of front-end unit testing and the basic jestapi. In this article, I will first introduce Enzyme, and then write test cases for it combined with a real component in the project.
๐จโ๐ Enzyme
In the last article, we actually briefly introduced enzyme, but t ...
Added by robin01 on Fri, 17 Sep 2021 23:21:01 +0300
From project construction to plug-in publishing to npm
preface
In our usual development work, we can pull out many common components and methods and publish them in the form of npm plug-ins on npm or our own npm private library to achieve the reuse effect.
Taking a react plug-in as an example, this article will go through a series of steps, such as development project construction, plug-in writin ...
Added by drummerboy on Wed, 15 Sep 2021 21:55:43 +0300
[acquisition technology] on the cancellation of repeated http requests
Scenario:
As developers, we mostly contact CRUD and joint debugging of various interfaces, but we seem to pay less attention to the http request we send. When the request is not fully completed and a new request is sent, how should we deal with the current request? We know that in order to prevent repeated actions, we can use anti shake and th ...
Added by EY on Sat, 11 Sep 2021 09:16:11 +0300
Summarize interview questions about vue and js [continuously updated]
1, vue
1. vue bidirectional data binding principle
Vue adopt Object Above the prototype defineProperty method,
For each Vue In the file data Data traversal,
Pass for each variable or attribute defineProperty Data rewriting to achieve two-way binding
2. How to unbind bidirectional data binding
First, define global variables, and then json.s ...
Added by electricshoe on Sat, 11 Sep 2021 08:35:43 +0300
React entry notes, no basic pre-school development
Create react app is a global command line tool used to create a new project. React scripts are the development dependencies required for a generated project.
In order to use React in the browser, two class libraries need to be referenced: React and React dom. The React library is used to create views, and the React DOM library is used to rende ...
Added by jbbaxx on Fri, 10 Sep 2021 07:19:10 +0300
(React-Native Learning Sixth) react-native-router-flux component learning
It feels good to see a video of this component on youtube.
This is a navigation component, navigation is an important part of the app
github address
The use of direct jump is very intuitive and simple.Look at the code and make a simple comment
//index.js
import React, { Component } from 'react';
import { Router, Scene } from 'react- ...
Added by GrecoClub on Thu, 16 Jul 2020 19:14:33 +0300