世界上最伟大的投资就是投资自己的教育
-
使用一个随机数做 key,这样 dispatch 了这个 action 之后都会做强制更新,会产生不必要的 re-rendering。另外你为什么要这么麻烦做一个 id 在 reducer 里面呢?为什么不直接
reminders.map((reminder, index) => {
return (
{ reminder.text }
time
);
}) -
constructor(props) {
super(props)
this.state = {
text: ''
};
}这个代码在我们公司 code review 过不了
-
case ADD_REMINDER:
return [
...state,
reminder(action)
]reducer 里面应该用{}, 而不是 []
我很讶异,你的代码是如何运行的
© 汕尾市求知科技有限公司 | Rails365 Gitlab | Qiuzhi99 Gitlab | 知乎 | b 站 | 搜索
粤公网安备 44152102000088号 | 粤ICP备19038915号
Top