diff -r 7da1d5137b0b -r 03334a31130a client/src/components/Note.js --- a/client/src/components/Note.js Tue Nov 06 16:19:26 2018 +0100 +++ b/client/src/components/Note.js Thu Nov 08 16:03:28 2018 +0100 @@ -6,6 +6,18 @@ class Note extends Component { + constructor(props) { + super(props); + this.editorInst = React.createRef(); + } + + get editor() { + if(this.editorInst && this.editorInst.current) { + return this.editorInst.current; + } + return null; + } + onClickDelete = (e) => { e.preventDefault(); e.stopPropagation(); @@ -15,10 +27,10 @@ onClickButton = (e) => { - const plain = this.refs.editor.asPlain(); - const raw = this.refs.editor.asRaw(); - const html = this.refs.editor.asHtml(); - const categories = this.refs.editor.asCategories(); + const plain = this.editor.asPlain(); + const raw = this.editor.asRaw(); + const html = this.editor.asHtml(); + const categories = this.editor.asCategories(); // const marginComment = this.marginComment.value; const data = { @@ -43,7 +55,7 @@ if (this.props.isEditing) { return (