From 9e64a22884521035f7ff722804eb8f5503323cda Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 6 Sep 2018 11:44:13 +0100 Subject: [PATCH] s/DidMount/WillMount/ in MessageComposerInput This fixes the tests that broke with https://github.com/matrix-org/matrix-js-sdk/pull/717 This is because of https://github.com/vector-im/riot-web/blob/master/test/app-tests/joining.js#L63 which prevents the DOM nodes from actually ending up in the DOM, even though the react components get rendered. This means that WillMount and WillUnmount are called, but not DidMount. Using WillMount is more symmertrical anyway since the resulting teardown code must be in WillUnmount (since there is no DidUnmount). --- src/components/views/rooms/MessageComposerInput.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index 267db89e8c..d5e45386bd 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -336,7 +336,7 @@ export default class MessageComposerInput extends React.Component { } } - componentDidMount() { + componentWillMount() { this.dispatcherRef = dis.register(this.onAction); this.historyManager = new ComposerHistoryManager(this.props.room.roomId, 'mx_slate_composer_history_'); }