Skip to content

Commit

Permalink
fix: Verify valid element before rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronP github.com Apowell829@gmail.com committed Jan 17, 2022
1 parent 68fce44 commit eaa1c1a
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 eaa1c1a

Please sign in to comment.