5

I am using SVG inside React, but the amount of SVG tags that ReactJS allows is limited and I don't see a way to embed an <image/> SVG tag inside my JSX.

I've also tried using a fill style on a rect set to a url of an image, but it doesn't work either. Is there a workaround for this?

Sergi Mansilla
  • 12,495
  • 10
  • 39
  • 48

1 Answers1

2

SVG Image is now supported in 0.14.

For prior versions, you can use dangerouslySetInnerHTML. For more about that, take a look at this issue:

https://github.com/facebook/react/issues/2069

freddyrangel
  • 1,353
  • 1
  • 11
  • 20