但在父组件上,我将状态作为道具传递。为什么我不能在这里得到这个.props.status?
class App extends Component{
render(){
return (
<div>
<childComponent
status={true}
/>
<div>
)
}
}
ChildComponent.js子组件
class childComponent extends Component{
render(){
console.log("props passed", this.props.status) // getting true
return(
)
}
}
export default reduxForm({
form: 'wizard',
destroyOnUnmount: false,
forceUnregisterOnUnmount: true,
enableReinitialize: this.props.status ? true : false, // error happening
})(
connect(
mapStateToProps,
mapDispatchToProps
)(childComponent)
);
与这个问题有关
Realted question