Skip to content

Commit a32704a

Browse files
authored
Silence React error about getDerivedStateFromProps (#29544)
Signed-off-by: Michael Telatynski <[email protected]>
1 parent 5b1be70 commit a32704a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/components/structures/RightPanel.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ export default class RightPanel extends React.Component<Props, IState> {
6464
public static contextType = MatrixClientContext;
6565
declare public context: React.ContextType<typeof MatrixClientContext>;
6666

67+
public constructor(props: Props) {
68+
super(props);
69+
70+
this.state = RightPanel.getDerivedStateFromProps(props);
71+
}
72+
6773
private readonly delayedUpdate = throttle(
6874
(): void => {
6975
this.forceUpdate();

0 commit comments

Comments
 (0)