Khanetor
Khanetor

Reputation: 12304

Using <image> svg tag with React

I wish to use the svg <image> tag with React, but it is not supported at the moment.

Is there any workaround other than inserting html dangerously?

Will it be supported in the near future?

What is the reason this particular svg tag is not supported?

Thanks

Upvotes: 0

Views: 679

Answers (2)

gazdagergo
gazdagergo

Reputation: 6691

It is now supported just use:

<svg>
  <image xlinkHref="//url.of.image" width={600} height={400} />
</svg>

Upvotes: 0

Guilherme Rodrigues
Guilherme Rodrigues

Reputation: 2854

  • There is no other workaround other than dangerouslySetInnerHTML
  • You should watch Issue #1657 as they will probably announce it there when it's ready

Upvotes: 1

Related Questions