From eaa1c1ad13da98fd25d871402e8ff2298a30eb7a Mon Sep 17 00:00:00 2001 From: "AaronP github.com Apowell829@gmail.com" <> Date: Mon, 17 Jan 2022 15:25:43 +0000 Subject: [PATCH] fix: Verify valid element before rendering --- src/utils/transpile/errorBoundary.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utils/transpile/errorBoundary.js b/src/utils/transpile/errorBoundary.js index 71294f67..de56a2d8 100644 --- a/src/utils/transpile/errorBoundary.js +++ b/src/utils/transpile/errorBoundary.js @@ -7,7 +7,11 @@ const errorBoundary = (Element, errorCallback) => { } render() { - return typeof Element === 'function' ? : Element; + return typeof Element === 'function' ? ( + + ) : React.isValidElement(Element) ? ( + Element + ) : null; } }; };