this.props.getBirdsData();
if (
hardTerm === 'ball' && terms === 'bat' &&
swmming < running
) {
this.props.getSportsData();
}
this.setState({ radioButtonValues: radioButtonValues });
一个工作文件
componentDidMount() {
this.props.initialize(this.state);
this.props.getRun();
console.log("step1 componentDidMount this.props--->", this.props);
this.props.getBirdsData();
// console.log(" componentDidMount this.props.getBirdsData()--->", this.props.adminRun);
}
componentWillReceiveProps(nextProps) {
if (this.props.adminRun.length != nextProps.adminRun.length) {
let adminRuns = nextProps.adminRun.data.filter(val => val.packageType === "Run");
const radioButtonValues = adminRuns.map(obj => {
return { label: obj.ownerCode + obj.subPackageDescription, value: obj.ownerCode };
});
this.setState({ radioButtonValues: radioButtonValues });
}
}
两个不起作用的文件
componentDidMount() {
this.props.getSportsData();
}
renderMoon() {
const { terms, hardTerm } = this.state;
const { classes, handleSubmit, handleSkip, handleBack } = this.props;
let running = moment(new Date());
if (this.props.form.Page && this.props.form.Page.values) {
let swmming = moment(this.props.form.Page.values.swmming, "MM/DD/YYYY");
if (
hardTerm === 'ball' && terms === 'bat' &&
swmming < running
) {
// debugger;
console.log('renderMoon inside if--->');
this.props.getSportsData();
}
}
}