Pass icon type to icon component
See original GitHub issueWould it make sense to pass the type prop onto the custom component here:
https://github.com/Maronato/vue-toastification/blob/514e84794dc09bba9b880b4f22b5b902c927ed9d/src/components/VtIcon.vue#L2
so that it could set custom styling based on that?
Currently, we can do that based on classes set on parent components but it’s not as clean (wouldn’t easily let me use same component for vue-toastification and other code).
Setting a prop that custom component doesn’t handle is fine, I believe. There should be no error. The only issue would be if that component already handles prop with the same name but that is unlikely I guess.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
How do I style a material-ui Icon which was passed as prop
I want to apply the iconStyle to the icon passed in as props.statusImage but can't figure out how. import PropTypes from "prop-types"; ...
Read more >Passing icons as props in a consistent way using React
This just simply passes a react component with its own props directly into the icon prop. This is a totally fine way to...
Read more >React Icon Component - Material UI
With the Icon component, a React wrapper for custom font icons. ... you can try passing the Font Awesome SVG data directly to...
Read more >Corrent way to pass material icons as props - JavaScript
The problem appears when I'm trying to pass Material UI icons (HomeIcon, SearchIcon etc) as props to my child component.
Read more >How to pass an icon reference to a component?
I am making components in my powerapp, and I want to pass a icon pointer as an input parameter, but it seems to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The solution works for me. Thank you very much for your support. 😃
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.