1

In React you can change the color of an icon with icon context or the style attribute:

<IconContext.Provider 
  value={{size: '40px' ,stroke: 'red',color:'red',fill:'red}} 
>
  <FaTasks>
</IconContext.Provider>

but it's not working what did i wrong i found some similar request on stackoverflow and some sort of bug request on github https://github.com/react-icons/react-icons/issues/404 or is it possibel that some react icons can't be styled with colors

and what's the difference between stroke ,fill ,color?

Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
Jonas
  • 13
  • 5
  • In the context of SVGs, you can think of `stroke` as a `border` property, and `fill` as `background` property (for blocks) or `color` property (for text). If you want to change the colour of an svg icon you will most likely need to change the `fill` property. By the way, your properties look invalid, you might want to take another look at the documentation on how to style icons, i.e. pass down `style` props, or (better) `className` props. See: https://github.com/react-icons/react-icons#configuration – UncaughtTypeError Oct 28 '21 at 18:40

1 Answers1

0

just add color prop or fill prop, i cant remember which one. lol

<FaTasks color="red" fill="red">

Dean Van Greunen
  • 5,060
  • 2
  • 14
  • 28