From 724fc68e00e994f132d08a92957c94e4434a7485 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Sat, 10 Jul 2021 09:24:54 +0200 Subject: [PATCH] Minor renaming --- src/editor/widgets/WrappedWidget.jsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/editor/widgets/WrappedWidget.jsx b/src/editor/widgets/WrappedWidget.jsx index 9b9ac4e..cc7737a 100644 --- a/src/editor/widgets/WrappedWidget.jsx +++ b/src/editor/widgets/WrappedWidget.jsx @@ -1,17 +1,18 @@ import React, { Component } from 'react'; export default class WrappedWidget extends Component { + constructor(props) { super(props); this.element = React.createRef(); } - updateWidget(props) { + renderWidget(props) { const widgetEl = this.props.widget({ annotation: props.annotation, readOnly: props.readOnly, - ...this.props.config, + ...props.config, onAppendBody: body => props.onAppendBody(body), onUpdateBody: (previous, updated) => props.onUpdateBody(previous, updated), onRemoveBody: body => props.onRemoveBody(body), @@ -26,13 +27,13 @@ export default class WrappedWidget extends Component { } componentDidMount() { - this.updateWidget(this.props); + this.renderWidget(this.props); } componentWillReceiveProps(next) { if (this.element.current) { if (this.props.annotation !== next.annotation) { - this.updateWidget(next); + this.renderWidget(next); } } }