尝试在react-redux中调用动作函数时出现此错误:
TypeError:this.props.currentAppointmentRequest不是函数
我已经在componentDidMount方法上调用了该函数,并且还尝试了将该函数绑定到构造函数中。
这是我正在调用的动作函数。
import { CURRENT_APPOINTMENT_REQUEST } from "../constants/Common";
export function currentAppointmentRequest() {
return {
type: CURRENT_APPOINTMENT_REQUEST
}
TypeError:this.props.currentAppointmentRequest不是函数 AppointmentPage.fetchCurrentAppointmentRequest C:/用户/sonwabiles/qeasyserverworkspace/app/src/components/appointments/AppointmentPage.js:15 12 | } 13 | 14 | fetchCurrentAppointmentRequest(){
15 | this.props.currentAppointmentRequest() | ^ 16 | } 17 | 18 | componentDidMount(){