You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change a route and add a createResource using the onHydrated option
Open up the route in the browser
onHydrated will not be called during client hydration
Expected behavior
The onHydrated option in createResource should be called during hydration (if I understand the usecase for this option properly)
Screenshots or Videos
onHydrated.reprod.mp4
Platform
OS: [Linux]
Browser: [Firefox]
Version: [1.3.17 and 1.4.0-beta.2]
Additional context
Potential solution:
During my debugging I noticed, that the variable p is empty during hydration. But the variable v is set and has the proper value. Replacing p with v at the following line, would solve the problem and make it so that onHydrated is actually called:
Describe the bug
The onHydrated option in createResource is not called during hydration.
Your Example Website or App
https://github.com/katywings/solid-on-hydrated-repro/blob/master/src/routes/index.tsx
Steps to Reproduce the Bug or Issue
onHydratedoptionExpected behavior
The onHydrated option in createResource should be called during hydration (if I understand the usecase for this option properly)
Screenshots or Videos
onHydrated.reprod.mp4
Platform
Additional context
Potential solution:
During my debugging I noticed, that the variable
pis empty during hydration. But the variablevis set and has the proper value. Replacingpwithvat the following line, would solve the problem and make it so that onHydrated is actually called:solid/packages/solid/src/reactive/signal.ts
Line 523 in 1ceb607
But tbh. i don't understand the full
createResourcelogic... changingptovmight break other things 😅.Video of my proposed solution:
onHydrated.fix.mp4
Sidenote: this is related to the discord discussion about TurboSolid: https://discordapp.com/channels/722131463138705510/722167424186843267/971362009184620584