Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 764 Bytes

File metadata and controls

42 lines (28 loc) · 764 Bytes

React introduction

Hooks

basic hooks

useState

1.setState

2.state type is Object

pay attention to use setState. In general, you should build a new Object.

useEffect

There are three vital types

useMemo

useCallback

Memo

useTransition

core question

1.component render

  • the state itself changed by user behaviour.
  • parent component rendered.
  • the context changed.

2.skill

use Date.now() to print the component state.

3.Reduce the times of render as much as possible

  • split the components
  • use Reduce(you can learn the Selector)

4. fiber

about router

@tanstack/react-router

use @tanstack/router-plugin and vite to generate the file path router.