摘要: constructor useState getDerivedStateFromProps useState 里面 update 函数 shouldComponentUpdate useMemo render 函数本身 componentDidMount useEffect componentDid 阅读全文
posted @ 2023-05-30 16:35 若栖1017 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 1.生命周期 主要包含3个阶段 分别是挂载,更新,卸载 挂载阶段包含: 1.construct 数据初始化 2.componentWillMount render之前调用 代表已经初始化数据但是没有渲染dom,因此在此方法中同步调用setState不会被额外触渲染 3.getDerivedState 阅读全文
posted @ 2023-05-30 16:32 若栖1017 阅读(12) 评论(0) 推荐(0) 编辑