From e741d0d577bdbc32d14f42b356b0d115b0a23033 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 1 Apr 2020 13:41:24 -0600 Subject: [PATCH 1/2] 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"); From 620c2effdade236ba1a5cea2cae508b4451eaf21 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 1 Apr 2020 13:52:49 -0600 Subject: [PATCH 2/2] Appease the linter by turning it off --- src/components/views/rooms/RoomBreadcrumbs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/rooms/RoomBreadcrumbs.js b/src/components/views/rooms/RoomBreadcrumbs.js index 98018130e4..1d433c9a40 100644 --- a/src/components/views/rooms/RoomBreadcrumbs.js +++ b/src/components/views/rooms/RoomBreadcrumbs.js @@ -50,7 +50,7 @@ export default class RoomBreadcrumbs extends React.Component { } // TODO: [REACT-WARNING] Move this to constructor - UNSAFE_componentWillMount() { + UNSAFE_componentWillMount() { // eslint-disable-line camelcase this._dispatcherRef = dis.register(this.onAction); const storedRooms = SettingsStore.getValue("breadcrumb_rooms");