React中p标签使用可编辑属性时 存在的问题

当在React中使用p标签的html5可编辑属性contentEditable时存在警告报错,报错内容:

A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional.

解决方案添加suppressContentEditableWarning 属性

实例:<p suppressContentEditableWarning contentEditable="true" onSelect={this.selectGetValue.bind(this)}>${render}</p>

问题解决

发布了17 篇原创文章 · 获赞 3 · 访问量 4054

猜你喜欢

转载自blog.csdn.net/HPFBoy/article/details/87793117