state值变了,但是组件没被渲染?
reducer是一个纯函数,不能在reducer直接修改state。reducer函数有两个参数:previousState, action,返回一个新的newState。state在reducer中是指针引用,直接修改state、store内部的state同样也就变了,但是redux认为 dispatch 前后的 state 没有改变,就不会重新渲染页面,实际上 state 已经改变了。

image.png