SolidJSS
SolidJSโ€ข3y agoโ€ข
5 replies
joalisonx

createResource returns undefined

Hello, goodnight everyone. Im having a problem using createResource. This function returns me undefined whenever I try to log it (console.log(data())). I tested to see that this wasn't an issue in my API by logging the response in the fetcher function and everything was as expected. The strangest thing is that I can normally render the result of this resource even though it is undefined.
const [data] = createResource(getGames);
<For each={data()}>{game => (<Game {...game}/>)}</For>
Was this page helpful?