Home

0

setState()

Data in React state cannot be changed directly The code in the example is to directly change (wrong) 1234changeWeather(){ const isHot=this.state.isHotthis.state.Hot=!isHot //Error!console.l

0

Function

Definition of function In JavaScript, a function is a reusable piece of code that can be called multiple times. It can accept inputs (called parameters), process these inputs, and return a result (

0

Class components

Create class components If the class defines the component, the class must inherit React’s built-in class: React.Component 1class MyComponent extends React. Component{} Among them, the co

0

Hoisting

Determine the type of variable typeof operator. Used to determine whether a variable is a primitive type or an object type. 1console.log(typeof(a)) instanceof operator: Mainly used to detect whet

0

Operators

Relational Operators basic: > < >= <= == === (same as ==, but does not allow any type conversions) != (opposite of ==) !== (opposite of ===) == is to determine whether the values ar

0

Class knowledge review

Console output class Red represents that the output is an instance object, and blue represents who created the instance object. Person {} If the constructor of the class does not receive parameter

0

Component

Module and component definitions Module: Generally, a .JS file is a module (developed by function) Component: A collection of JS+HTML+CSS code and resources (developed by region) Developer Tools R

0

Virtual DOM, JSX

**Why React uses JSX instead of native JS? ** Case 1: Create the following example with JS and JSX 123<div id="test"> <h1 id="title">Hello,React</h1></div

0

Introduction

React Family Bucket React core React- Router routing library PubSub message management library Redux centralized state management library Ant-Design UI component library React definition React: A

0

Variable

Variable naming Variable names can be capitalized because JS is case-sensitive. Variable assignment = is an assignment symbol. The usage is to assign the value on the right side of the equal sign