michelson / dante2

A complete rewrite of dante editor in draft-js

Home Page:https://michelson.github.io/dante2/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

On init console warning

asrebo opened this issue · comments

when i include Dante2 in my project i get warning in my console several times:

Warning: A string ref, "editor", has been found within a strict mode tree. String refs are a source of potential bugs and should be avoided. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref

and also when im passing prop "save_handler={ function (editorContext, content){...}}" it never gets called

i'm curenty using latest version of react

The warning goes away when you build the project for production, btw are you on v0.5.0-rc25 because I'm not receiving this warning

I get the same when using both 0.5.0-rc4 and v0.5.0-rc25

react: 16.13.1
react-dom: 16.13.1

It looks like react: 16.13.1 adds <React.StrictMode> to the index.js file now. You can read more about it here

for the meantime you can just remove the <React.StrictMode> tags