Merge pull request #4361 from matrix-org/t3chguy/fix_composer_placeholder1

Fix composer placeholder not updating
This commit is contained in:
Michael Telatynski 2020-04-08 10:45:35 +01:00 committed by GitHub
commit 4d7f3ba109
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,8 +94,7 @@ export default class BasicMessageEditor extends React.Component {
this._emoticonSettingHandle = null; this._emoticonSettingHandle = null;
} }
// TODO: [REACT-WARNING] Move into better lifecycle position componentDidUpdate(prevProps) {
UNSAFE_componentWillUpdate(prevProps) { // eslint-disable-line camelcase
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) {