lucide icon indicating copy to clipboard operation
lucide copied to clipboard

Changed the exemple of dynamic icons using NextJS

Open morrisseybr opened this issue 1 year ago • 6 comments

This pr resolves the issue #1576.

morrisseybr avatar Sep 27 '23 14:09 morrisseybr

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Oct 28 '23 01:10 github-actions[bot]

Tried this locally, but unfortunately, it crashed my app. Are you sure this works with Next 13+ App router? Here's my error image

dani-z avatar Oct 30 '23 08:10 dani-z

Tried this locally, but unfortunately, it crashed my app. Are you sure this works with Next 13+ App router? Here's my error image

Can you show your implementation and the use of the example that you are doing?

morrisseybr avatar Nov 16 '23 11:11 morrisseybr

Tried this locally, but unfortunately, it crashed my app. Are you sure this works with Next 13+ App router? Here's my error image

Can you show your implementation and the use of the example that you are doing?

I think his issue is that dynamicIconImports uses kebab-case icon names, while your apporach requires PascalCase I've stumbled at exactly the same issue in my project that I very recently moved from non-optimized generic component to the one using dynamicIconImports But as reported in issue the slowness of dev server brought me here

KajSzy avatar Nov 23 '23 23:11 KajSzy

@KajSzy converting the name to pascal case solved my issue. Dev server is super fast now. Thanks!

bernatfortet avatar Dec 13 '23 02:12 bernatfortet

@morrisseybr this only works client-side. Any idea how to make it work within a Server Component?

ben519 avatar Dec 15 '23 23:12 ben519