From e741d0d577bdbc32d14f42b356b0d115b0a23033 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 1 Apr 2020 13:41:24 -0600 Subject: [PATCH] Revert componentDidMount changes on breadcrumbs Fixes https://github.com/vector-im/riot-web/issues/12990 Regressed in https://github.com/matrix-org/matrix-react-sdk/pull/4313 --- src/components/structures/LeftPanel.js | 3 ++- src/components/views/rooms/RoomBreadcrumbs.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/structures/LeftPanel.js b/src/components/structures/LeftPanel.js index bbeaeb10e0..a9cd12199b 100644 --- a/src/components/structures/LeftPanel.js +++ b/src/components/structures/LeftPanel.js @@ -44,7 +44,8 @@ const LeftPanel = createReactClass({ }; }, - componentDidMount: function() { + // TODO: [REACT-WARNING] Move this to constructor + UNSAFE_componentWillMount: function() { this.focusedElement = null; this._breadcrumbsWatcherRef = SettingsStore.watchSetting( diff --git a/src/components/views/rooms/RoomBreadcrumbs.js b/src/components/views/rooms/RoomBreadcrumbs.js index ad8a5cfef9..98018130e4 100644 --- a/src/components/views/rooms/RoomBreadcrumbs.js +++ b/src/components/views/rooms/RoomBreadcrumbs.js @@ -49,7 +49,8 @@ export default class RoomBreadcrumbs extends React.Component { this._scroller = createRef(); } - componentDidMount() { + // TODO: [REACT-WARNING] Move this to constructor + UNSAFE_componentWillMount() { this._dispatcherRef = dis.register(this.onAction); const storedRooms = SettingsStore.getValue("breadcrumb_rooms");