Answer the question
In order to leave comments, you need to log in
How to load data differently in a component?
I am creating a json tree. there is such a route
<Route path="entity/edit/:entity_id" component={EntityForm} />
componentWillMount() {
if(!isEmpty(this.props.entity_id)) {
this.props.actions.loadEntityRequest(this.props.entity_id) // устанавливает в reducer начальные данные структуры(entity)
}
}
const mapStateToProps = (state, ownProps) => {
return {
entity: state.entity
}
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question