I have a component that loads with the initial state:
getInitialState: function() { return { panel: "deals", showExtension: false, person: {} }; },
And I have this to find a person:
componentDidMount: function() { this.findPersonFromBackground(); }, findPersonFromBackground: function() { chrome.runtime.sendMessage({ action: "findPerson", email: this.props.currentEmail.from_email }, function(person) { this.setState({person: person}); }.bind(this)); },
So everything is working fine. If a person is found, I do one thing, and if not, then another.
When the first one is found, the view switches from an idle state to a real state state quickly, as the API calls are pretty fast.
What is the best way to wait while rendering this first call?
source share