I have 3 fetch functions: a(), b(a_id), c(b_id). Function a will return an a_id and pass to function b, and b will return an id and pass to c.
componentDidUpdate(prevProps) {
this.gotoanotherPage(this.props.a_id);
}
generateBody() {
this.props.a();
this.props.b(this.props.a_id);
this.props.c(this.props.b_id);
}
render() {
body = generateBody();
return <framework {body}/>
}
My problem is a() has not finished fetching and getting a response back yet, yet b and c already execute and this.props.a_id and this.props.b_id are undefined. I couldn't modify the a,b, and c functions.
Anyone know how to set a function call in an order?