Closed zacksiri closed 7 years ago
+1
I am getting this error with the demo files
dist.js:13308 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 PrismEditorExample)
in div (created by PrismEditorExample)
in div (created by PrismEditorExample)
in PrismEditorExample
+1
warning.js:36 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 BasicHtmlEditor)
in div (created by BasicHtmlEditor)
in div (created by BasicHtmlEditor)
in BasicHtmlEditor (created by Editor)
in div (created by Editor)
in Editor (created by exports)
in div (created by exports)
in div (created by exports)
in exports (created by exports)
in div (created by exports)
in div (created by exports)
in exports (created by exports)
in exports (created by Main)
in div (created by Main)
in div (created by Main)
in Main
Hi, has anyone solved this problem?
Tried the following:
$ git clone https://github.com/SamyPesse/draft-js-prism.git
$ cd draft-js-prism
$ yarn && yarn start
Project starts, syntax highlighting however doesn't work: no tokenisation happening.
I ended up using PrismDraftDecorator class from this gist instead of from draft-js-code. It's working well for me.
setting the javascript
as the defaultSyntax
in the options.js file gets it working
I've created a wrapper around this decorator specifically for draft-js-plugins
, draft-js-prism-plugin
, which works.
Feel free to open a new issue on the draft-js-prism-plugin
repo if you're still experiencing this problem!
Hey!
I am trying to use draft-js-prism with draft-js-code in my editor here is my code, I did inspect element its not even tokenizing the code.
edit: it seems that I can't use the editor from the draft-js-plugin