-
Notifications
You must be signed in to change notification settings - Fork 666
Open
Labels
Description
I have component, that is connected to redux via mapStateToProps by createStructuredSelector:
const mapStateToProps = createStructuredSelector({
countReports: makeSelectCountReports(),
});where makeSelectCountReports is:
export const makeSelectCountReports = () => createSelector(
makeSelectReportDetails(),
// other selectors
(reportDetails, ...) => {
...
},
);where makeSelectReportDetails is:
export const makeSelectReportDetails = () => createSelector(
[
selectProjectProviderDomain(),
(state, type) => type,
],
(substate, type = ScaleAnswerKeys.Top2) => (
type === ScaleAnswerKeys.Top2
? substate.top2Report
: substate.top1Report
),
);When I call makeSelectReportDetails via useSelector and not pass type arg, all works fine. But with mapStateToProps I have a problem - I think, that ownProps passed to selector and this breaks my flow. How can I use selector with mapStateToProps and not automatically pass ownProps to him?