This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,10 @@ import React, {
2525} from "react" ;
2626import { MatrixClient } from "matrix-js-sdk/src/client" ;
2727
28- const MatrixClientContext = createContext < MatrixClient | undefined > ( undefined ) ;
28+ // This context is available to components under LoggedInView,
29+ // the context must not be used by components outside a MatrixClientContext tree.
30+ // This assertion allows us to make the type not nullable.
31+ const MatrixClientContext = createContext < MatrixClient > ( null as any ) ;
2932MatrixClientContext . displayName = "MatrixClientContext" ;
3033export default MatrixClientContext ;
3134
Original file line number Diff line number Diff line change @@ -38,7 +38,10 @@ import {
3838 VoiceBroadcastRecordingsStore ,
3939} from "../voice-broadcast" ;
4040
41- export const SDKContext = createContext < SdkContextClass | undefined > ( undefined ) ;
41+ // This context is available to components under MatrixChat,
42+ // the context must not be used by components outside a SdkContextClass tree.
43+ // This assertion allows us to make the type not nullable.
44+ export const SDKContext = createContext < SdkContextClass > ( null as any ) ;
4245SDKContext . displayName = "SDKContext" ;
4346
4447/**
You can’t perform that action at this time.
0 commit comments