Skip to content

Instantly share code, notes, and snippets.

@amarbalu
Last active March 12, 2022 15:58
Show Gist options
  • Save amarbalu/b5132cca881a463a06237e9e9d7fc371 to your computer and use it in GitHub Desktop.
Save amarbalu/b5132cca881a463a06237e9e9d7fc371 to your computer and use it in GitHub Desktop.
render() {
if (this.state.loading || this.state.error) {
return React.createElement(opts.loading, {
isLoading: this.state.loading,
pastDelay: this.state.pastDelay,
timedOut: this.state.timedOut,
error: this.state.error,
retry: this.retry
});
} else if (this.state.loaded) {
return opts.render(this.state.loaded, this.props);
} else {
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment