1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-16 06:42:26 +03:00

Fix soft crash when editing message

Fixes https://github.com/matrix-org/riot-web-rageshakes/issues/2504
This commit is contained in:
Travis Ralston
2020-04-01 16:22:42 -06:00
parent 31ec984c86
commit 8e405dda2e

View File

@@ -94,7 +94,8 @@ export default class BasicMessageEditor extends React.Component {
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) {
const {isEmpty} = this.props.model;
if (isEmpty) {