1、componentWillMount  将要装载,在render之前调用;

      componentDidMount,(装载完成),在render之后调用

2、componentWillMount  每一个组件render之前立即调用;

      componentDidMount  render之后并不会立即调用,而是所有的子组件都render完之后才可以调用

3、componentWillMount  可以在服务端被调用,也可以在浏览器端被调用;

      componentDidMount  只能在浏览器端被调用,在服务器端使用react的时候不会被调用

相关文章:

  • 2022-12-23
  • 2021-12-26
  • 2022-02-14
  • 2022-12-23
  • 2021-05-10
  • 2021-10-16
  • 2021-11-02
  • 2021-07-31
猜你喜欢
  • 2022-12-23
  • 2021-10-07
  • 2021-08-10
  • 2022-12-23
  • 2022-12-23
  • 2022-03-10
  • 2021-09-18
相关资源
相似解决方案