Skip to content

Commit

Permalink
fix onHydrate call being skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed Oct 30, 2023
1 parent 45c5e64 commit 80ca972
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/clean-dancers-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"solid-js": patch
---

fix `onHydrate` call being skipped
2 changes: 1 addition & 1 deletion packages/solid/src/reactive/signal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -692,12 +692,12 @@ export function createResource<T, S, R>(
loadEnd(pr, p, undefined, lookup);
return p;
}
pr = p;
if ("value" in p) {
if ((p as any).status === "success") loadEnd(pr, p.value as T, undefined, lookup);
else loadEnd(pr, undefined, undefined, lookup);
return p;
}
pr = p;
scheduled = true;
queueMicrotask(() => (scheduled = false));
runUpdates(() => {
Expand Down

2 comments on commit 80ca972

@indeyets
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryansolid can something like this be tested to avoid regressions? 🤔

@ryansolid
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah.. the tests are pretty vacant in terms of SSR or hydration right now. This one might be easy to do without much setup though.

Please sign in to comment.