Skip to content

Commit 5eae2b6

Browse files
authored
Merge pull request #182 from Yoshify/fix/null-initial-context
fix: set initial context value to null
2 parents f5d8097 + 7814fcb commit 5eae2b6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/hooks/useKindeAuth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { KindeContext, KindeContextProps } from "../state/KindeContext";
44
export const useKindeAuth = (): KindeContextProps => {
55
const context = useContext(KindeContext);
66

7-
if (context === undefined) {
7+
if (context === null) {
88
throw new Error("Oooops! useKindeAuth must be used within a KindeProvider");
99
}
1010

src/state/KindeContext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ const initialContext = {
4747
...initialState,
4848
};
4949

50-
export const KindeContext = createContext<KindeContextProps>(
51-
initialContext as KindeContextProps,
50+
export const KindeContext = createContext<KindeContextProps | null>(
51+
null
5252
);

0 commit comments

Comments
 (0)