Hook

constructor useState
getDerivedStateFromProps useState 里面 update 函数
shouldComponentUpdate useMemo
render 函数本身
componentDidMount useEffect
componentDidUpdate useEffect
componentWillUnmount useEffect 里面返回的函数
componentDidCatch
getDerivedStateFromError

常用方法:

1.useState

2.useEffect

3.useContext

4.useReducer

5.useCallback

6.useMemo

7.useRef

一。useEffect

它被称为副作用钩子。它可以让你在函数组件中执行副作用操作

 

posted @ 2023-05-30 16:35  若栖1017  阅读(31)  评论(0编辑  收藏  举报