We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e3ec932 commit cdc39f9Copy full SHA for cdc39f9
src/ui-react/context.ts
@@ -59,7 +59,7 @@ const useThing = <
59
isUndefined(id)
60
? contextValue[offset]
61
: isString(id)
62
- ? objGet(contextValue[offset + 1] as IdObj<Thing>, id)
+ ? objGet((contextValue[offset + 1] ?? {}) as IdObj<Thing>, id)
63
: id
64
) as Thing;
65
};
@@ -83,7 +83,7 @@ const useThingOrThingById = <
83
84
85
export const useThingIds = (offset: number): Ids =>
86
- objIds(useContext(Context)[offset] as IdObj<unknown>);
+ objIds((useContext(Context)[offset] ?? {}) as IdObj<unknown>);
87
88
export const useStore: typeof useStoreDecl = (id?: Id): Store | undefined =>
89
useThing(id, 0);
0 commit comments