From bd599c96a3b8cd02120e43ecf29c260221b1d49f Mon Sep 17 00:00:00 2001 From: Germain Souquet Date: Thu, 23 Sep 2021 14:43:39 +0100 Subject: [PATCH] Add React lifecycle methods publicity and return types --- src/components/structures/RightPanel.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/structures/RightPanel.tsx b/src/components/structures/RightPanel.tsx index 32a875557c..a108f376bd 100644 --- a/src/components/structures/RightPanel.tsx +++ b/src/components/structures/RightPanel.tsx @@ -143,14 +143,14 @@ export default class RightPanel extends React.Component { return rps.roomPanelPhase; } - componentDidMount() { + public componentDidMount(): void { this.dispatcherRef = dis.register(this.onAction); const cli = this.context; cli.on("RoomState.members", this.onRoomStateMember); this.initGroupStore(this.props.groupId); } - componentWillUnmount() { + public componentWillUnmount(): void { dis.unregister(this.dispatcherRef); if (this.context) { this.context.removeListener("RoomState.members", this.onRoomStateMember); @@ -159,7 +159,7 @@ export default class RightPanel extends React.Component { } // TODO: [REACT-WARNING] Replace with appropriate lifecycle event - UNSAFE_componentWillReceiveProps(newProps) { // eslint-disable-line + public UNSAFE_componentWillReceiveProps(newProps: IProps): void { // eslint-disable-line if (newProps.groupId !== this.props.groupId) { this.unregisterGroupStore(); this.initGroupStore(newProps.groupId);