我有两次经典计数器(加号按钮,减号按钮和显示的计数)(counter.js和counter2.js)两次。每个计数器都有自己的reducer和actions.js
我正在使用redux-logger,因此可以在控制台中看到。我可以告诉每个计数器更新其相应的“计数”。但是仅在控制台中。在实际的页面中,我有一个div来显示“计数”状态,但它根本没有显示。这就是我分别在counter.js和counter2.js中用来显示计数的
<div>{this.props.count}</div>
和
<div>{this.props.count}</div>
我有reducer.js和reducer2.js,它们分别包含
const initialState = {
count : 0,test:null
};
和
const initialState = {
count : 0,test:null
};
再次,在控制台中,使用redux logger,它们确实可以正确更新,所以我知道我的代码正在工作。我的问题是在div上称这些“计数”