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

[joy-ui][templates] Confusing import of feather-icons #40089

Closed
mdesantis opened this issue Dec 3, 2023 · 2 comments · Fixed by #40095
Closed

[joy-ui][templates] Confusing import of feather-icons #40089

mdesantis opened this issue Dec 3, 2023 · 2 comments · Fixed by #40095
Assignees
Labels
docs Improvements or additions to the documentation package: joy-ui Specific to @mui/joy

Comments

@mdesantis
Copy link

mdesantis commented Dec 3, 2023

Hello! While messing around with Joy UI's Order Dashboard template, I came across this puzzling piece of code:

const status = useScript('https://unpkg.com/feather-icons');
useEnhancedEffect(() => {
// Feather icon setup: https://github.com/feathericons/feather#4-replace
// @ts-ignore
if (typeof feather !== 'undefined') {
// @ts-ignore
feather.replace();
}
}, [status]);

I tried to figure out what it is for, but without luck. It imports feather-icons and then calls replace, that by docs should find all [data-feather] occurrences and inject their icons, but I have no evidence of this happening somewhere in the template; is it a typo, or some obscure magic I'm too noob to understand? 🤯

@github-actions github-actions bot added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 3, 2023
@danilo-leal danilo-leal changed the title Confusing import of feather-icons [joy-ui][templates] Confusing import of feather-icons Dec 4, 2023
@danilo-leal danilo-leal added docs Improvements or additions to the documentation package: joy-ui Specific to @mui/joy labels Dec 4, 2023
@zanivan
Copy link
Contributor

zanivan commented Dec 4, 2023

Hey @mdesantis good catch! This looks like some outdated code from the previous version of this template, where we've used feather-icons. I went ahead and opened a PR (#40095) to remove these, since we're using only the rounded Material Icons now.

@zanivan zanivan removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 4, 2023
@zanivan zanivan self-assigned this Dec 4, 2023
@siriwatknp
Copy link
Member

siriwatknp commented Dec 6, 2023

@mdesantis Thanks for pointing that out. That snippet is specific to our docs setup. I'd recommend to check out https://github.com/feathericons/react-feather for your project if you want to use feather icons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation package: joy-ui Specific to @mui/joy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants