Skip to content

Commit eaa1c1a

Browse files
author
AaronP github.com Apowell829@gmail.com
committed
fix: Verify valid element before rendering
1 parent 68fce44 commit eaa1c1a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/utils/transpile/errorBoundary.js

Lines changed: 5 additions & 1 deletion
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)