-
-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating new icons triggers 'unique "key" prop' error #2153
Comments
You can easily fix this by adding a key prop in the iconNode: const MyIconNode = [
['path', { d: 'M8 2v4', key: 'path1' }],
] |
Awesome, this works perfectly. I'll close the issue as this solves it entirely (it could maybe be added to the documentation, I was not able to find this information on my own). |
Be the change you want to see in the world 😉 |
Package
Version
0.378.0
Can you reproduce this in the latest version?
Browser
Operating system
Description
When creating a custom Icon component, with
createLucideIcon
function, and then using the new icon somewhere in a list, the following error appears on the console:This bug occured within a 'big' project so I tried to trigger it on a just created project: same issue.
Besides creating a react app and installing lucide-react, I simply wrote this code:
I am not sure what is causing this and hope I didn't miss an obvious error.
Steps to reproduce
createLucideIcon
(with a name a an icon node)For step 3, created icon cannot support a key prop, and putting the icon inside a div that has a key doesn't solve the issue.
Checklist
The text was updated successfully, but these errors were encountered: