Closed Zaid-Ajaj closed 8 years ago
I don't think so - and I don't think that it would make sense.. the "initial state" determines how to draw the component immediately, which is information that won't be available if there is an async operation that needs to be processed.
For cases like this, I tend to have a "no-data-yet" state - you might leave the Data property as null and display a "Loading.." symbol in that case. When the data becomes available, then you would call SetState and set a new value for Data, at which point you can render the component properly - with a "no results" message if there is no Data* or with the information that the Data reference contains.
Is there a way to do the following: