From 01885b95acd931ba59898a36839e9cbd520e6d21 Mon Sep 17 00:00:00 2001 From: Marco Cesarato Date: Mon, 7 Jun 2021 10:13:27 +0200 Subject: [PATCH] fix: check if empty on create element --- lib/utils.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/utils.js b/lib/utils.js index 8a15861..5f0b58c 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -134,5 +134,11 @@ export const mergeViewStyle = (style, defaultStyle) => { * @returns {JSX.Element|[]|*} */ export const createElement = (Component) => { - return React.isValidElement(Component) ? Component : ; + return Component != null ? ( + React.isValidElement(Component) ? ( + Component + ) : ( + + ) + ) : null; };