We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c34d8c commit bdcb1f9Copy full SHA for bdcb1f9
src/index.js
@@ -20,11 +20,11 @@ class ErrorBoundary extends React.Component {
20
error,
21
resetErrorBoundary: this.resetErrorBoundary,
22
}
23
- if (fallback) {
+ if (React.isValidElement(fallback)) {
24
return fallback
25
- } else if (fallbackRender) {
+ } else if (typeof fallbackRender === 'function') {
26
return fallbackRender(props)
27
- } else if (FallbackComponent) {
+ } else if (typeof FallbackComponent === 'function') {
28
return <FallbackComponent {...props} />
29
} else {
30
throw new Error(
0 commit comments