废弃生命周期方法,新增生命周期方法
在16.8以前,没有Hooks时,只能用class组件下面的API方法来进行操作页面渲染
挂载期
**constructor()**
static getDeriveStateFormProps()
**render()**
**componentDidMount()**
废弃的方法
UNSAFE_componentWillMount()
更新期
static getDerivedStateFromProps()
shouldComponentUpdate()
**render()**
getSnapShotBeforeUpdate()
**ComponentDidUpdate()**
废弃的方法
UNSAFE_componentWillUpdate()
UNSAFE_com[onentWillReceiverProps()
卸载期
**componentWillUnmount()**
注:加粗的方法都是比较常用的方法
createRef
组件懒加载
const LazyPDFDocument = React.lazy(() => import("./PDFPreview"));
Fragment
<></>
组件外部构建total
Hooks的各种API