You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I've been playing around with the new DynamicIcon component, described here as a replacement for "lucide-react/dynamicIconImports". I noticed that when using an incorrect name prop, the fallback component is rendered instead, but there still the following error message in dev mode: "Name in Lucide DynamicIcon not found". I don't seem to be able to handle that error via an error boundary. Example:
<DynamicIconname="invalidName"fallback={()=><p>Some fallback content like a default icon</p>}/>
Use cases
Hiding the error message or downgrading it to a warning, when there is a valid fallback component, would make working with dynamic icon names via props more pleasant, as showing a fallback component for an icon wouldn't automatically trigger an error.
Checklist
I have searched the existing issues to make sure this bug has not already been reported.
The text was updated successfully, but these errors were encountered:
maurer2
changed the title
Hide error message for DynamicIcon when a valid fallback component is present
Hide error message "Name in Lucide DynamicIcon not found" for DynamicIcon when a valid fallback component is present
Jan 22, 2025
Package
Description
Hello, I've been playing around with the new
DynamicIcon
component, described here as a replacement for "lucide-react/dynamicIconImports". I noticed that when using an incorrect name prop, the fallback component is rendered instead, but there still the following error message in dev mode: "Name in Lucide DynamicIcon not found". I don't seem to be able to handle that error via an error boundary. Example:Use cases
Hiding the error message or downgrading it to a warning, when there is a valid fallback component, would make working with dynamic icon names via props more pleasant, as showing a fallback component for an icon wouldn't automatically trigger an error.
Checklist
The text was updated successfully, but these errors were encountered: