zoukankan      html  css  js  c++  java
  • react笔记

    static getDerivedStateFromProps(nextProps, prevState) {
    console.log('getDerivedStateFromProps',nextProps, prevState)
    }
    componentDidMount() {
    console.log('componentDidMount',this.props, this.state)
    }
    shouldComponentUpdate(nextProps, nextState) {
    console.log('shouldComponentUpdate',nextProps, nextState)
    return true
    }
    getSnapshotBeforeUpdate(prevProps, prevState){
    console.log('getSnapshotBeforeUpdate',prevProps, prevState)
    return 222
    }
    componentDidUpdate(prevProps, prevState,snapshot) {
    console.log('componentDidUpdate',prevProps, prevState,snapshot)
    }
    render(){
    return <React.Fragment>地图Component</React.Fragment>
    }
    getDerivedStateFromProps {orderId: "35201366854752"} {}
    componentDidMount {orderId: "35201366854752"} {}

    getDerivedStateFromProps {orderId: 2} {}
    shouldComponentUpdate {orderId: 2} {}
    getSnapshotBeforeUpdate {orderId: "35201366854752"}ref: (...)orderId: "35201366854752"get ref: ƒ ()proto: Object {}
    componentDidUpdate {orderId: "35201366854752"} {} 222

  • 相关阅读:
    316. 去除重复字母
    331. 验证二叉树的前序序列化
    225. 用队列实现栈
    197. 上升的温度
    178. 分数排名
    177. 第N高的薪水
    小程序导航
    css3、js动画特效
    背景透明css
    h5新标签IE8不兼容怎么办?
  • 原文地址:https://www.cnblogs.com/leee/p/12120082.html
Copyright © 2011-2022 走看看