Skip to content

Commit

Permalink
Icon: no verbose on name undefined
Browse files Browse the repository at this point in the history
Signed-off-by: Abhinav Kumar <[email protected]>
  • Loading branch information
abhinavkrin committed Sep 24, 2023
1 parent 913a231 commit 58e2e22
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/react/src/components/Icon/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 58e2e22

Please sign in to comment.