Skip to content

Instantly share code, notes, and snippets.

@jasdeepsingh
Created April 27, 2017 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasdeepsingh/39b251c5e24f52810732c3ae1bf2f20d to your computer and use it in GitHub Desktop.
Save jasdeepsingh/39b251c5e24f52810732c3ae1bf2f20d to your computer and use it in GitHub Desktop.
react component
class Component extends React.Component {
component___Mount() { // didMount? willMount?
window.api.asyncCallToBackend() // returns promise
}
render() {
return (<data here that depends on response of async call in one lifecycle methods>)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment