作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的组件中有一些如下代码。
<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
语法,您收到错误,React 不知道如何编译它。使用驼峰式大小写表示法,即 xmlnsXlink
。
试试这个:
<svg id="SvgjsSvg3254" width="318" height="152" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlnsXlink="http://www.w3.org/1999/xlink" xmlnsSvgjs="http://svgjs.dev/svgjs" class="apexcharts-svg" xmlnsData="ApexChartsNS" transform="translate(0, 0)" style="background: transparent none repeat scroll 0% 0%;">
关于reactjs - 如何在 React.js 中打开 'throwIfNamespace' 标志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59138677/
我的组件中有一些如下代码。 我收到如下错误 Namespace tags are not supported by default. React's JSX doesn't support name
以为这很简单,但事实并非如此。我使用最新的 create-react-app 生成了一个简单的应用程序。添加 标记并获取以下内容: Namespace tags are not supported b
我是一名优秀的程序员,十分优秀!