我正在使用react-redux-firebase和populate方法来混合来自集合的数据,一切都很好,除了我不能使用来自redux的createStructuredSelector和mapStateToProps,因为createStructuredSelector替换了它,所以我在寻找解决方案,如何将它与事物组合
const mapStateToProps = (state: any) => {
const items = populate(state.firestore, 'Skill', populates);
const seletors = createStructuredSelector({
loading: makeSelectFSCollectionStatus('requesting', COLLECTION),
skills: makeSelectFSCollectionOrdered(COLLECTION),
});
return seletors;
}
我需要以某种方式将items插入到seletors中
发布于 2021-05-03 02:30:59
找到解决方案
const mapStateToProps = (state: any) => {
const items = populate(state.firestore, 'Skill', populates);
const seletors = createStructuredSelector({
loading: makeSelectFSCollectionStatus('requesting', COLLECTION),
skills: makeSelectFSCollectionOrdered(COLLECTION),
});
const t: any = seletors(state);
t.items = items;
return t;
};
https://stackoverflow.com/questions/67359412
复制相似问题