feathericons / react-feather

React component for Feather icons
https://npm.im/react-feather
MIT License
1.92k stars 126 forks source link

Change Icon Color onHover #24

Closed wake-0 closed 5 years ago

wake-0 commented 5 years ago

Hello,

is there any easy way to add a hover effect e.g. when mouseOver change color to yellow? I tried the following:

onMouseOver={(evt) => evt.target.setAttribute('style', 'stroke: gray')}
onMouseLeave={(evt) => evt.target.setAttribute('style', 'stroke: white')}

But this has got a problem with multiple paths. It does only color the selected path not all paths of the svg.

carmelopullara commented 5 years ago

You can easily achieve that with CSS.

https://css-tricks.com/using-svg/#article-header-id-9