webstrand
Stale read in <List><Show><List>
https://playground.solidjs.com/anonymous/ccb906d4-c9f1-437f-9f72-e94279b0e25d
I am stumped, I don't know why the stale read is happening, I don't know why it's triggered by that stream of states and not others.
Note that the playground doesn't render the error message correctly, here's the dev message:
Uncaught Error: Attempting to access a stale value from <Show> that could possibly be undefined. This may occur because you are reading the accessor returned from the component at a time where it has already been unmounted. We recommend cleaning up any stale timers or async, or reading from the initial condition.
17 replies
How to onCleanup an async resource from createResource?
or
or
or something else entirely?
I need to cleanup the connection when the resource re-fetches, and when the whole subtree is disposed of. If I don't the browser leaks the resource and eventually crashes.
70 replies
<Show> not tracking signals
For some reason when I use another signal inside of Show's callback, it does not track that signal. When I don't use Show's callback, everything works fine.
https://playground.solidjs.com/anonymous/9581e103-9f05-4744-ba92-f285dc89d19f
28 replies
Resource state never updates when consumed by <Show>
https://playground.solidjs.com/anonymous/d47ac50e-b5d4-4b1c-8cff-d2c8ed7e1199
Refetch the resource until it fails to make a joke, observe that the
joke.state
never updates afterward.
Is this a bug?36 replies
Adapting a list of objects to signals
I've got an API that returns a list of objects like
I fetch this data using
useResource
and I render it out with a tree of components like
The problem comes when I invalidate the resource and re-fetch it, all of the Result
components get re-rendered from scratch, because the objects are different. And even if the objects were the "same" then they wouldn't update properly because props.result.value
isn't a signal.
Does solid provide any tools for mapping data like this into signals so that my components can be reactive to it?8 replies