code style
This commit is contained in:
@@ -81,9 +81,7 @@ class ReactNodeView implements NodeView {
|
|||||||
const ReactNodeView: React.FunctionComponent = (props) => {
|
const ReactNodeView: React.FunctionComponent = (props) => {
|
||||||
const [isEditable, setIsEditable] = useState(this.editor.isEditable)
|
const [isEditable, setIsEditable] = useState(this.editor.isEditable)
|
||||||
const onDragStart = this.onDragStart.bind(this)
|
const onDragStart = this.onDragStart.bind(this)
|
||||||
const onViewUpdate = () => {
|
const onViewUpdate = () => setIsEditable(this.editor.isEditable)
|
||||||
setIsEditable(this.editor.isEditable)
|
|
||||||
}
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
this.editor.on('viewUpdate', onViewUpdate)
|
this.editor.on('viewUpdate', onViewUpdate)
|
||||||
|
|||||||
Reference in New Issue
Block a user