React native 生命周期

 组件加载的时候触发的函数: 

    constructor 、componentWillMount、 render 、componentDidMount (dom操作,请求数据)

组件数据更新的时候触发的生命周期函数:

    shouldComponentUpdate(nextProps, nextState) 是否要更新数据,接收两个参数,return true;才会执行更新数据操作

    componentWillUpdate、render、componentDidUpdate

父组件里面改变props传值的时候触发的:

    componentWillReceiveProps

组件销毁的时候触发的:

    componentWillUnmount

相关文章:

  • 2021-10-03
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2021-10-17
猜你喜欢
  • 2021-12-31
  • 2021-12-18
  • 2022-12-23
相关资源
相似解决方案