Skip to content

Commit

Permalink
Merge pull request #288 from AaronPowell96/fix/#283-console-crashing
Browse files Browse the repository at this point in the history
fix #283: Verify valid element before rendering
  • Loading branch information
jpdriver committed Jan 18, 2022
2 parents 09074af + eaa1c1a commit cd481af
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/transpile/errorBoundary.js
Expand Up @@ -7,7 +7,11 @@ const errorBoundary = (Element, errorCallback) => {
}

render() {
return typeof Element === 'function' ? <Element /> : Element;
return typeof Element === 'function' ? (
<Element />
) : React.isValidElement(Element) ? (
Element
) : null;
}
};
};
Expand Down

0 comments on commit cd481af

Please sign in to comment.