From 573ef5647dca4654d48b0e756f441bf1ad0cbd34 Mon Sep 17 00:00:00 2001 From: thecodrr Date: Wed, 1 Apr 2020 23:12:39 +0500 Subject: [PATCH] feat: make react-quill generic --- apps/web/src/components/editor/react-quill.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/web/src/components/editor/react-quill.js b/apps/web/src/components/editor/react-quill.js index f87c57c5f..04604e292 100644 --- a/apps/web/src/components/editor/react-quill.js +++ b/apps/web/src/components/editor/react-quill.js @@ -42,7 +42,9 @@ export default class ReactQuill extends Component { } shouldComponentUpdate(nextProps) { - return this.props.readOnly !== nextProps.readOnly || nextProps.refresh; + return ( + this.props.readOnly !== nextProps.readOnly || nextProps.refresh || false + ); } componentDidUpdate() { @@ -62,10 +64,11 @@ export default class ReactQuill extends Component { readOnly, initialContent, onChange, - onSave + onSave, + id } = this.props; - this.quill = new Quill("#quill", { + this.quill = new Quill("#" + id, { placeholder, bounds: container, modules, @@ -102,6 +105,6 @@ export default class ReactQuill extends Component { }; render() { - return
;
+    return 
;
   }
 }