javascript - When using combineReducers, the reducer and action are named differently and the action cannot be executed
PHP中文网
PHP中文网 2017-06-26 10:56:41
0
1
723

There is only one reducer at the beginning, so it can be used directly by introducing it in the entry file.
Later, when there were more reducers and more actions, I wanted to split the reducers out and merge them into one large reducer through combineReducers before giving it to createStore.
But I found that if the action and the corresponding reducer are not named the same, the action will not be executed.
Has anyone encountered the same problem? What should I do if the names of action and reducer are different?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(1)
小葫芦

Your usage is wrong. Just match the type of action dispatch with the type in reducer

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template