开发者社区 问答 正文

说一说React的生命周期?

展开
收起
前端问答 2019-12-24 12:44:24 1445 分享 版权
2 条回答
写回答
取消 提交回答
  • componentWillMount/componentWillUpdate shouldComponentUpdate render componentDidMount/componentDidUpdate componentWillUnmount

    2020-03-27 21:47:36
    赞同 展开评论
  • 简单来说,一个组件的生命周期可以分为四个部分:

    创造 - 生
    挂载到页面
    更新
    毁灭 - 死

    2019-12-24 16:42:06
    赞同 展开评论