简体   繁体   English

使用 <image> 带有React的svg标签

[英]Using <image> svg tag with React

I wish to use the svg <image> tag with React, but it is not supported at the moment. 我希望在React中使用svg <image>标签,但目前尚不支持。

Is there any workaround other than inserting html dangerously? 除了危险地插入html之外,还有其他解决方法吗?

Will it be supported in the near future? 不久的将来会支持吗?

What is the reason this particular svg tag is not supported? 不支持此特定svg标记的原因是什么?

Thanks 谢谢

  • There is no other workaround other than dangerouslySetInnerHTML 除了dangerouslySetInnerHTML以外,没有其他解决方法
  • You should watch Issue #1657 as they will probably announce it there when it's ready 您应该观看第1657期,因为他们可能会在准备就绪时在那里宣布

It is now supported just use: 现在支持使用:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM