前端笔记之react生命周期操作和行内样式

componentWillMount

componentDidMount

  • 一般在此加载数据
  • 页面的主要配置信息位置
  • 定时器时器位置

shouldComponentUpdate nextProps nextState

  • 数据更新时可以在此检测

render

  • return()接收props和state并解构

componentDidUpdate

componmentWillUnmount

componmentunMount

  • 定时器卸载位置

    //行内样式

    let sty = { backgroundColor:'blue', color:'#ff671b', fontSize:40 }; //JSX的调用

    行内样式测试
    行内样式测试

猜你喜欢

转载自blog.csdn.net/qq_45393395/article/details/120564684