我无法将redux存储值获取到props,我检查了reducers,store,action和JS文件,一切正常。但是,同时将选择器传递给mapStateToProps。
错误

错误:未捕获(承诺)TypeError:Object(...)不是函数
at selectHosDeatilsResult (AddAppointment.js?0a10:319)
import React from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
class example extends React.PureComponent {
render() {
console.log('this.props', this.props);
return (
<div>
</div>
);
}
}
const selectHosDeatilsResult = () => createSelector(
makeHospitalResult(),
value => ({ value }),
);
const mapStateToProps = state => ({
details: selectDeatilsResult()(state),
});
export default connect(mapStateToProps, null)(example);
Run Code Online (Sandbox Code Playgroud)
减速器代码
const initialState = fromJS({
hospitalResult: null,
});
export default function Reducer(state = initialState, action) { …Run Code Online (Sandbox Code Playgroud)