Cannot reference properties of object stored in a signal after being fetched from API
I fetch some data via a REST API and store it in a signal within the
onMount
hook. The signal stores an array of the fetched data. I can reference all top level members of that array, but when I try to reference their properties I get an error.
This only happens for me when I fetch the data from an API. When I pass in the static data via prop or just initialize the signal with the data, it doesn't happen.
A reproduction of the problem is below (and also here: https://playground.solidjs.com/anonymous/cd6419ab-38e5-43c8-846e-44dcc9233896)
I think there is something fundamental I am missing.
2 Replies