每次状态更改时都会调用重新选择选择器参数

时间:2021-01-25 11:39:17

标签: react-redux reselect

我的状态是为了简单

export default combineReducers({
    combinedReducer1,
    combinedReducer2,
});

我有一个 mapStateToProps 如下:

 const mapStateToProps = state => ({
    reducer1: testReselect(state)
});

testReselect 在哪里

const testReselect = createSelector(
    state => state,
    state => state
);

并且我看到在 combineReducer1 中的每个嵌套更改上都调用了重新选择。任何嵌套状态更改中的 rootState 引用不应该相同吗?如果没有,使用重新选择有什么意义吗?

0 个答案:

没有答案