Skip to content

Commit

Permalink
Add <title> tag if the prop is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
Swanand01 committed Jun 19, 2024
1 parent fb70c42 commit 317dd9b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions icon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ export default function Icon({
className = 'icon',
glyph = '',
viewBox = '',
title,
...restProps
}) {
return (
<svg className={className} viewBox={viewBox} {...restProps}>
{title && <title>{title}</title>}
<use xlinkHref={`#${glyph}`} />
</svg>
);
Expand Down

0 comments on commit 317dd9b

Please sign in to comment.