From 58e2e22c1ba121b1b52a19433f85a61811d0dff7 Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Sun, 24 Sep 2023 14:46:14 +0530 Subject: [PATCH] Icon: no verbose on name undefined Signed-off-by: Abhinav Kumar --- packages/react/src/components/Icon/Icon.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/react/src/components/Icon/Icon.js b/packages/react/src/components/Icon/Icon.js index ba8038eda..1e56484e9 100644 --- a/packages/react/src/components/Icon/Icon.js +++ b/packages/react/src/components/Icon/Icon.js @@ -11,6 +11,9 @@ const Icon = ({ size = 24, name, className = '', style = {}, ...props }) => { ); const IconComponent = useMemo(() => svgIcons[name], [name]); + if (!name) { + return null; + } if (!IconComponent) { console.log(`No icon found for ${name}`); return null;