Skip to content
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

fix: add displayName to aid debugging #92

Merged
merged 1 commit into from
Jul 19, 2024
Merged

fix: add displayName to aid debugging #92

merged 1 commit into from
Jul 19, 2024

Conversation

stipsan
Copy link
Member

@stipsan stipsan commented Jul 18, 2024

Currently our icons show up as Anonymous when inspected in the React DevTools on builds that minify the output, like here:
image

By adding displayName we ensure that no matter what kind of bundling is used you can still see the icon name:
image

Wrapping then name like this Icon.displayName = 'ForwardRef(Icon)' instead of just Icon.displayName = 'Icon' is how React renders the little ForwardRef label next to the name. .

@stipsan stipsan requested a review from snorrees July 18, 2024 22:12
Copy link

vercel bot commented Jul 18, 2024

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

Name Status Preview Comments Updated (UTC)
icons ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 18, 2024 10:12pm

Copy link

@snorrees snorrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, this is so useful!

@stipsan stipsan merged commit 5e3e1cd into main Jul 19, 2024
10 checks passed
@stipsan stipsan deleted the add-display-name branch July 19, 2024 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants