draft-js icon indicating copy to clipboard operation
draft-js copied to clipboard

Component's children should not be mutated- [email protected] [email protected]

Open mzbac opened this issue 10 years ago • 17 comments

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)

mzbac avatar Aug 10 '16 07:08 mzbac

Me too

blade254353074 avatar Aug 12 '16 12:08 blade254353074

+1

feliperohdee avatar Aug 12 '16 17:08 feliperohdee

+1

vinhlh avatar Aug 15 '16 02:08 vinhlh

+1

haridusenadeera avatar Aug 15 '16 15:08 haridusenadeera

+1

walter0331 avatar Aug 16 '16 07:08 walter0331

+1

meiyouqing avatar Aug 16 '16 08:08 meiyouqing

+1

vagusX avatar Aug 18 '16 02:08 vagusX

+1

zaklampert avatar Aug 18 '16 19:08 zaklampert

+1

jsiebern avatar Aug 19 '16 13:08 jsiebern

+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)

houkanshan avatar Aug 22 '16 07:08 houkanshan

+1

sleeper avatar Aug 31 '16 14:08 sleeper

+1

delijah avatar Sep 02 '16 22:09 delijah

+1

SanthoshBabuMR avatar Sep 03 '16 10:09 SanthoshBabuMR

+1

jjkavalam avatar Sep 03 '16 17:09 jjkavalam

+1

bradbirnbaum avatar Sep 05 '16 02:09 bradbirnbaum

+1 How to fix it?

[email protected] [email protected]

blackcater avatar Sep 08 '16 02:09 blackcater

@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

echenley avatar Sep 08 '16 19:09 echenley