Umi: 引用 svg 作为 react 组件输出,会提示:React无法识别DOM元素上的`pId`

Created on 28 Oct 2018  ·  5Comments  ·  Source: umijs/umi

index.js:2178 Warning: React does not recognize the pId prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase pid instead. If you accidentally passed it from a parent component, remove it from the DOM element.

Need Reproduce

Most helpful comment

将所有svg里的p-id属性全部去掉就可以了

All 5 comments

请提供可复现的库。

有问题再 reopen 。

的确,icon svg是从iconfont下载的
import { ReactComponent as DingweiSVG } from 'assets/img/dingwei.svg';

console警告:
index.js:2178 Warning: React does not recognize the pId prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase pid instead. If you accidentally passed it from a parent component, remove it from the DOM element.

warning 忽略吧,要深究的话可以搜下 svgo+pId

将所有svg里的p-id属性全部去掉就可以了

Was this page helpful?
0 / 5 - 0 ratings

Related issues

onReadyL picture onReadyL  ·  3Comments

afc163 picture afc163  ·  3Comments

kitebear picture kitebear  ·  3Comments

Artoria-0x04 picture Artoria-0x04  ·  3Comments

zhanchengkun picture zhanchengkun  ·  3Comments