-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Describe the bug
Normally The resources start at "rending" state before they become "ready". When the initial value is passed the resources start at "refreshing", as it's considered a subsequent request of sorts.
But passing undefined as the initial value — e.g. when creating a custom primitive with createResource and passing the user's parameter strength through as the initial value, which by default will be undefined — results in the "refreshing" initial state. Which seems a bit odd as undefined kinda reads as "user did not defined an initial value" 🙃
So I'm wondering if this is intended as we got an issue on solid-primitives because of this behavior.
Interestingly, the solution to fix this on our side is to check initialValue !== undefined and not pass the property at all if it's not defined, which is funny because this is exactly what I would expect resources to do instead of pushing this problem downstream.
Your Example Website or App
https://playground.solidjs.com/anonymous/dcf0dc7e-6f56-4b30-be43-ed0a850190a4
Steps to Reproduce the Bug or Issue
Look at the console
Expected behavior
Both resources should have the same initial state