Tag: React

0

Custom hooks

Where to use With custom Hooks, component logic can be extracted into reusable functions. React Hooks means that components should be written as pure functions as much as possible. If external funct

0

useEffect

useEffect() side effects Pure functions can only perform data calculations. Where should operations that do not involve calculations (such as generating logs, storing data, changing application stat

0

useState

Basic usage 1const [count, setCount] = useState(initialState) count is to read state, setCount is to update state, and initialState is initial value. ​ State is an array Because React renderin

0

props in route@5

Pass the params parameter There are three ways to carry parameters in ajax: query, params, body. The body parameter has two encoding forms: urlencoded and json. There is also a params form in routin

0

Nested route@5

Secondary route writing method (in the @6 version there is no such problem) File location: The component folder is created under the first-level routing folder. Navigation link location: in the rout

0

Advanced usage of route@5

Routing components and general components General components are placed in the src-components tag, but routing components are not in compliance with the specification. When standardizing developmen

0

Basic usage of route@5

React-router understanding A plugin library for react. (react-xxx are basically plug-in libraries) The library we installed here is not react-router. react-router has three libraries for three pla

0

SPA, route

SPA Definition Single page web application (single page web application, SPA). The entire application has only one complete page. (Single page with multiple components) That is, there is only th

0

Fetch

Send request method classification xhr class: ajax (native xhr, troublesome), jQuery (third party, may generate callback hell), axios (third party) fetch: (built-in non-third-party, promise style)

0

PubSub

Passing values (communication) between sibling components Passing values between parent and child components: With the help of props, the child passes a function to the parent with props, and the ch