diff --git a/.changeset/hip-pumas-smile.md b/.changeset/hip-pumas-smile.md new file mode 100644 index 000000000..ce4ad2f3d --- /dev/null +++ b/.changeset/hip-pumas-smile.md @@ -0,0 +1,5 @@ +--- +"solid-js": patch +--- + +fix #2236 improper shortcircuit in resource hydration diff --git a/packages/solid/src/reactive/signal.ts b/packages/solid/src/reactive/signal.ts index 542cbf950..8351b8a4d 100644 --- a/packages/solid/src/reactive/signal.ts +++ b/packages/solid/src/reactive/signal.ts @@ -623,7 +623,7 @@ export function createResource( id = sharedConfig.getNextContextId(); let v; if (options.ssrLoadFrom === "initial") initP = options.initialValue as T; - else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v; + else if (sharedConfig.load && sharedConfig.has!(id)) initP = sharedConfig.load(id); } function loadEnd(p: Promise | null, v: T | undefined, error?: any, key?: S) { if (pr === p) {