【发布时间】:2018-01-05 05:45:52
【问题描述】:
我是 React 的新手。
场景:
Redux State 有:X、Y、Z 对象:
class A {
render(){...}
}
mapstatetoprops(){
return { X: x1}
}
connect(mapstatetoprops)(A)
我在某处读到,当 X、Y 或 Z 中的 redux 状态发生变化时,connect 调用 mapstatetoprops 来重新渲染组件 A。
但是,我只想在更改 X 时重新渲染 A。这可能吗?
【问题讨论】:
标签: reactjs react-redux