From 26740b88c4a03fe486dc957c8da04f7f57428044 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Thu, 10 Aug 2023 11:47:36 -0700 Subject: [PATCH] fix #1848 Suspense Default Context Non-Null --- .changeset/dry-fishes-report.md | 5 +++++ packages/solid/src/reactive/signal.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/dry-fishes-report.md diff --git a/.changeset/dry-fishes-report.md b/.changeset/dry-fishes-report.md new file mode 100644 index 000000000..a9df6524f --- /dev/null +++ b/.changeset/dry-fishes-report.md @@ -0,0 +1,5 @@ +--- +"solid-js": patch +--- + +fix #1848 Suspense Default Context Non-Null diff --git a/packages/solid/src/reactive/signal.ts b/packages/solid/src/reactive/signal.ts index 9f7cd7823..1cd7a2d81 100644 --- a/packages/solid/src/reactive/signal.ts +++ b/packages/solid/src/reactive/signal.ts @@ -1201,7 +1201,7 @@ export type SuspenseContextType = { resolved?: boolean; }; -type SuspenseContext = Context & { +type SuspenseContext = Context & { active?(): boolean; increment?(): void; decrement?(): void; @@ -1210,7 +1210,7 @@ type SuspenseContext = Context & { let SuspenseContext: SuspenseContext; export function getSuspenseContext() { - return SuspenseContext || (SuspenseContext = createContext({})); + return SuspenseContext || (SuspenseContext = createContext()); } // Interop