Last active
March 12, 2022 15:58
-
-
Save amarbalu/b5132cca881a463a06237e9e9d7fc371 to your computer and use it in GitHub Desktop.
React-loadable package -https://github.com/jamiebuilds/react-loadable/blob/6201c5837b212d6244c57f3748f2b1375096beeb/src/index.js#L100
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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