Fix soft crash when editing message

Fixes https://github.com/matrix-org/riot-web-rageshakes/issues/2504
pull/21833/head
Travis Ralston 2020-04-01 16:22:42 -06:00
parent 31ec984c86
commit 8e405dda2e
1 changed files with 2 additions and 1 deletions

View File

@ -94,7 +94,8 @@ export default class BasicMessageEditor extends React.Component {
this._emoticonSettingHandle = null; this._emoticonSettingHandle = null;
} }
componentDidUpdate(prevProps) { // TODO: [REACT-WARNING] Move into better lifecycle position
UNSAFE_componentWillUpdate(prevProps) {
if (this.props.placeholder !== prevProps.placeholder && this.props.placeholder) { if (this.props.placeholder !== prevProps.placeholder && this.props.placeholder) {
const {isEmpty} = this.props.model; const {isEmpty} = this.props.model;
if (isEmpty) { if (isEmpty) {