reactjs 在 div 上面加 contentEditable="true" 的时候报警告怎么处理?如图

index-fcc9874e.js:53908 Warning: 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.
    in div (created by c1)
    in div (created by c1)
    in c1 (created by CssMagic)
    in div (created by CssMagic)
    in CssMagic (created by Route)
    in Route
    in Switch
    in div
    in Router (created by BrowserRouter)
    in BrowserRouter

clipboard.png

图片描述

阅读 10.8k
2 个回答

在contentEditable上添加suppressContentEditableWarning="true" V15以上可用

我感觉无法处理,要么你就不要加contentEditable

推荐问题