Skip to content

Commit cd481af

Browse files
authored
Merge pull request #288 from AaronPowell96/fix/#283-console-crashing
fix #283: Verify valid element before rendering
2 parents 09074af + eaa1c1a commit cd481af

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/utils/transpile/errorBoundary.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ const errorBoundary = (Element, errorCallback) => {
77
}
88

99
render() {
10-
return typeof Element === 'function' ? <Element /> : Element;
10+
return typeof Element === 'function' ? (
11+
<Element />
12+
) : React.isValidElement(Element) ? (
13+
Element
14+
) : null;
1115
}
1216
};
1317
};

0 commit comments

Comments
 (0)