【发布时间】:2020-03-27 01:14:21
【问题描述】:
我的组件中有如下代码。
<svg id="SvgjsSvg3254" width="318" height="152" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.dev/svgjs" class="apexcharts-svg" xmlns:data="ApexChartsNS" transform="translate(0, 0)" style="background: transparent none repeat scroll 0% 0%;">
我收到如下错误
Namespace tags are not supported by default. React's JSX doesn't support namespace tags. You can turn on the 'throwIfNamespace' flag to bypass this warning.
如何打开“throwIfNamespace”标志?
【问题讨论】:
-
我用于像 xmlns:xlink 这样的属性,在将 svg 导出为 react 组件时尝试使用 xmlnsXlink。
标签: reactjs svg xml-namespaces javascript-namespaces