How do I use SVG in styled components?

How do I use SVG in styled components?
Answer
The styled components way.
…
The gotchas
  1. You should remove any id props from every svg element.
  2. Watch out for props like fill-rule and stroke-width. …
  3. Some icons use style definitions instead of props (fill, stroke, …), in which case, you should convert the style definitions into props.
24.04.2020
 

Tìm kiếm

Back
Top