世界上最伟大的投资就是投资自己的教育

全场限时 5 折


id 4342

benli615349


见习 小学生


  • 使用一个随机数做 key,这样 dispatch 了这个 action 之后都会做强制更新,会产生不必要的 re-rendering。另外你为什么要这么麻烦做一个 id 在 reducer 里面呢?为什么不直接
    reminders.map((reminder, index) => {
    return (



  • { reminder.text }
    time


  • );
    })
  • React & Redux 实战 Reminder Pro 项目免费视频教程 #2 显示列表

    constructor(props) {
    super(props)
    this.state = {
    text: ''
    };
    }

    这个代码在我们公司 code review 过不了

  • React & Redux 实战 Reminder Pro 项目免费视频教程 #2 显示列表

    case ADD_REMINDER:
    return [
    ...state,
    reminder(action)
    ]

    reducer 里面应该用{}, 而不是 []
    我很讶异,你的代码是如何运行的

  • © 汕尾市求知科技有限公司 | Rails365 Gitlab | Qiuzhi99 Gitlab | 知乎 | b 站 | 搜索

    粤公网安备 44152102000088号粤公网安备 44152102000088号 | 粤ICP备19038915号

    Top