next-learn icon indicating copy to clipboard operation
next-learn copied to clipboard

Update classname props to svg props in LinkIcon in nav-links.tsx

Open scifisatan opened this issue 1 year ago • 3 comments

Thee @heroicons/react library exports SVG icons as React components. These components accept all standard SVG props. However, the className prop passed into the component wasn't working as expected because SVGs have their own set of CSS properties.

Instead of using className, using the width and height props directly on the LinkIcon component works perfectly

scifisatan avatar Jan 29 '24 04:01 scifisatan

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-learn-starter ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 29, 2024 4:02am
next-seo-starter ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 29, 2024 4:02am

vercel[bot] avatar Jan 29 '24 04:01 vercel[bot]

@scifisatan is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Jan 29 '24 04:01 vercel[bot]

I found the issue while trying to mimick the Navbar but wasn't able to size the svg no matter what. Later I tried to look into it due to its strange behaviour and i found that using classname instead of svg properties was the issue for me. I was seeking through this specific code but this issue might persist on other sections of the codebase as well.

scifisatan avatar Jan 29 '24 04:01 scifisatan