Skip to content

Commit

Permalink
fix #1848 Suspense Default Context Non-Null
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed Aug 10, 2023
1 parent 31a45a2 commit 26740b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/dry-fishes-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"solid-js": patch
---

fix #1848 Suspense Default Context Non-Null
4 changes: 2 additions & 2 deletions packages/solid/src/reactive/signal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ export type SuspenseContextType = {
resolved?: boolean;
};

type SuspenseContext = Context<SuspenseContextType> & {
type SuspenseContext = Context<SuspenseContextType | undefined> & {
active?(): boolean;
increment?(): void;
decrement?(): void;
Expand All @@ -1210,7 +1210,7 @@ type SuspenseContext = Context<SuspenseContextType> & {
let SuspenseContext: SuspenseContext;

export function getSuspenseContext() {
return SuspenseContext || (SuspenseContext = createContext<SuspenseContextType>({}));
return SuspenseContext || (SuspenseContext = createContext<SuspenseContextType | undefined>());
}

// Interop
Expand Down

0 comments on commit 26740b8

Please sign in to comment.