React native 生命周期

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

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

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

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

    componentWillUpdate、render、componentDidUpdate

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

    componentWillReceiveProps

组件销毁的时候触发的:

    componentWillUnmount

相关文章:

  • 2020-02-10
  • 2020-10-11
  • 2020-10-30
  • 2018-12-11
  • 2021-10-16
  • 2021-10-13
  • 2021-08-13
  • 2018-12-17
猜你喜欢
  • 2020-11-13
  • 2018-05-19
  • 2018-08-16
  • 2018-12-13
  • 2018-09-19
相关资源
相似解决方案