• tytom2003

    请问第37页function SetTimeoutHOC (InnerComponent) 的InnerComponent内容是什么?

    tytom2003发表于 2022/3/5 16:49:43
  • fefeng

    第53页,
    原文: 那么我们可以定义这样一个 action creator 函数:
    const learnReduxActionFactory = book => { type: '', book }
    这个函数返回一个对象


    返回的对象应该加上括号 book => ({})

    fefeng发表于 2019/5/26 15:57:46
  • nbhaohao

    第 11 页
    2.1.4 PureComponent
    shouldComponentUpdate 中的代码错误,当 state 和 nextState 或 props 和 nextProps 相等的时候,应该返回false, 不应该返回 true.
    可以改成:

      shouldComponentUpdate(nextProps, nextState, nextContext) {
        const {props, state} = this
        function shallowCompare(a, b) {
          return a === b || Object.keys(a).every(k => a[k] === b[k])
        }
        const isStateEquals = shallowCompare(nextState, state)
        const isPropsEquals = shallowCompare(nextProps, props)
        if (isStateEquals && isPropsEquals) {
          return false
        }
        return true
      }
    

    nbhaohao发表于 2018/12/31 11:46:48
  • 静默岁月

    红色框里应该是{}而不是[]吧,t的数据类型是对象

    静默岁月发表于 2018/11/20 0:08:31
    • 静默岁月

      红色框里应该是{}而不是[]吧,t的数据类型是对象

      静默岁月发表于 2018/11/20 0:09:13
  • Soyas


    这里不应该是App么

    Soyas发表于 2018/9/13 2:40:29
    • lucasHC

      感谢指出,会在下一版修正

      lucasHC发表于 2018/9/28 14:14:49
  • 1
  • 2