Silence React error about getDerivedStateFromProps (#29544)

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2025-03-19 18:07:21 +00:00 committed by GitHub
parent 5b1be70ee8
commit a32704ae5b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -64,6 +64,12 @@ export default class RightPanel extends React.Component<Props, IState> {
public static contextType = MatrixClientContext;
declare public context: React.ContextType<typeof MatrixClientContext>;
public constructor(props: Props) {
super(props);
this.state = RightPanel.getDerivedStateFromProps(props);
}
private readonly delayedUpdate = throttle(
(): void => {
this.forceUpdate();