类组件和函数式组件的区别
原理、状态、生命周期、使用方式
类组件
● 类组件:构造,getDSfromProps, cDidMount,shouldCUpdate,cDidUpdate,cWillUnmounted....
● 函数组件:用 useEffect 代替 cDidMount,cDidUpdate,cWillUnmounted
原理、状态、生命周期、使用方式
● 类组件:构造,getDSfromProps, cDidMount,shouldCUpdate,cDidUpdate,cWillUnmounted....
● 函数组件:用 useEffect 代替 cDidMount,cDidUpdate,cWillUnmounted