Async/await in componentDidMount to load in correct order
setState is asynchronous, so you can’t determinate when the state is updated in a sync way. 1) I recommend you don’t use componentDidMount with async, because this method belongs to react lifecycle. Instead you could do: 2) The companyIdParams method doesn’t have a return, so you are waiting for nothing. If you need to wait … Read more