question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pass icon type to icon component

See original GitHub issue

Would 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:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rchlcommented, Apr 28, 2020

The solution works for me. Thank you very much for your support. 😃

0reactions
lock[bot]commented, May 5, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found