Hooks usage rules
Hooks is just a JavaScript method, but it should be used in the correct way. We provide a linter plug-in to automatically check.
Hooks is called only at the top level
Do not call Hooks in loops, conditional statements, or nested methods. To be called at the top level of your React method. Following this method, you can ensure that hooks are ...
Posted by pushpendra.php on Thu, 06 Jan 2022 01:46:50 +0100
Closures, constructors, and instantiated objects, prototype objects, and prototypes of JS underlying JS
1. Closure of JS
1. Definition
A closure is a function that has access to variables in the scope of another function. Simply put, you can think of a closure as a special function that reads functions of internal variables of other functions.
2. Role
Normal functions, after execution, the variables declared in the function will be garbage co ...
Posted by Dj_Lord on Wed, 05 Jan 2022 21:03:46 +0100
You may not have heard of DOM operations in js and this: HTMLCollection and NodeList
⛱️ preface
I still remember the last interview when I was asked about the relationship between htmlCollection and array. At that time, I was thinking about the relationship between sets and arrays in html. That is to say, the relationship between sets and arrays?
So... The interviewer immediately corrected me that htmlCollection is a c ...
Posted by Altec on Wed, 05 Jan 2022 20:38:13 +0100
Simple learning of svg
preface
I learned about canvas briefly before, and now I will learn about svg briefly, so as to enter a door for future work svg learning tutorial: Rookie tutorial For basic learning, you can see the rookie tutorial. If it is more complex, you can find some svg libraries
Recommended articles: Ruan Yifeng SVG image tutorial
svg
SVG means Sc ...
Posted by Nuggit on Wed, 05 Jan 2022 20:36:54 +0100
Quickly learn the difference between Vue2 and Vue3
Create data
Here is the biggest difference between Vue2 and Vue3 - Vue2 uses option type API compared with Vue3 synthetic API
The old optional API divides different attributes in the code, such as data, computed, methods, etc; The new composite API allows us to use methods to split, and use attributes to share compared with the old API, so th ...
Posted by s1akr on Wed, 05 Jan 2022 19:13:12 +0100
JS event binding, event triggering, event object, event delegate, throttling and anti chattering
This is some basic content of JavaScript events previously sorted out.
1, The origin of the event
With the rapid development of the Web, the static page of HTML+CSS can no longer meet the needs of users, so there is JavaScript that allows users to interact with the browser, and the great hero to realize this function is what we are talking ab ...
Posted by sarakmo on Wed, 05 Jan 2022 15:17:52 +0100
Description of low code delivery platform from architecture diagram to online
prefaceToday is December 27, 2021. A few days ago, the low code launch platform developed by our insurance team was finally launched. It took about four months from product planning to launch. This article does not introduce the concept of low code in detail, but directly introduces the conception process of the product from 0 to 1 in the R &am ...
Posted by Spoiler on Wed, 05 Jan 2022 14:54:32 +0100
"js learning notes" object oriented
1, Cognitive object
An object is a collection of "key value pairs", which represents the mapping relationship between attributes and values.
var xiaoming = {
name: 'Xiao Ming',
age: 12,
sex: 'male',
hobbies: ['Football', 'programming']
};
Attribute name (key): attribute value (value) In JS, braces represent o ...
Posted by not_skeletor on Wed, 05 Jan 2022 14:08:29 +0100
Day 21 of learning
Cross domain
What is cross domain The browser has a homology policy. When the 'protocol name', 'domain name' and 'port' of the url of the web page are the same, it is homology. One difference is cross domain Homology strategy The same origin policy restricts documents or scripts loaded from the same source, such as songs, from interacting with ...
Posted by jrbush82 on Wed, 05 Jan 2022 14:07:09 +0100
On the sorting and building process of Webpack
preface
Nowadays, many web pages can actually be regarded as function rich applications, which have complex JavaScript code and a lot of dependency packages. Modularity allows us to refine complex programs into small files; Similar to TypeScript, a development language developed on the basis of javascript: it enab ...
Posted by Namadoor on Wed, 05 Jan 2022 13:26:26 +0100