Component's children should not be mutated- [email protected] [email protected]
when try to toggle blockType to ordered-list-item, unordered-list-item, code-block. getting error :
VM16882 bundle.js:1302 Warning: Component's children should not be mutated. in pre in div (created by DraftEditorContents) in DraftEditorContents (created by DraftEditor) in div (created by DraftEditor) in div (created by DraftEditor) in div (created by DraftEditor) in DraftEditor (created by PluginEditor) in PluginEditor (created by KeyPathEditor) in div (created by KeyPathEditor)
it occurred for all those block that have wrapper element..
it caused by mutation checking
if (element._shadowChildren.length === element.props.children.length)
Me too
+1
+1
+1
+1
+1
+1
+1
+1
+1, [email protected] [email protected]
And I didn't get this error while using b5d87c2765f7a6e72cd0ae6618682e8d0c5556a3 (> 0.7.0 & < 0.8.0, 11 commits before 0.8.0)
+1
+1
+1
+1
+1
@blackcater The fix is in the master branch, but it hasn't been published to npm yet. Hopefully that happens soon. As a temporary measure, you could try using the master branch directly:
"draft-js": "git+https://github.com/facebook/draft-js.git"
Edit: unfortunately, this method doesn't appear to copy the correct files