Fix React contexts (#12855)

This commit is contained in:
Michael Telatynski 2024-08-01 13:01:05 +01:00 committed by GitHub
parent 9b77279b3e
commit b6addb4118
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 99 additions and 107 deletions

View file

@ -77,6 +77,7 @@ interface IState {
export default class TimelineCard extends React.Component<IProps, IState> {
public static contextType = RoomContext;
public context!: React.ContextType<typeof RoomContext>;
private dispatcherRef?: string;
private layoutWatcherRef?: string;
@ -84,8 +85,8 @@ export default class TimelineCard extends React.Component<IProps, IState> {
private card = React.createRef<HTMLDivElement>();
private readReceiptsSettingWatcher: string | undefined;
public constructor(props: IProps) {
super(props);
public constructor(props: IProps, context: React.ContextType<typeof RoomContext>) {
super(props, context);
this.state = {
showReadReceipts: SettingsStore.getValue("showReadReceipts", props.room.roomId),
layout: SettingsStore.getValue("layout"),