Now using createResource(), the content never loads.
All I ever see is
Loading...
in the rendering.
I'm using SSR with Cloudflare Pages.8 Replies
Do I need to trigger it to load any other way?
I am able to use createStore+createEffect, but wanted to use createResource.
This is a bit counter-intuitive. I'd been in the same situation when I started with solid. It would seem that the
loading
prop is meant for exactly the kind of code you showed but it's actually not doing anything in this case. You need to "access" the data, otherwise the resource will not do anything.
For your case, I guess just rewriting the when condition would suffice when={reports() && !reports.loading}
Yeah I did that too, and it didn't work.
reports.loading
would never be falseIf you have a look here, this should work. Be mindful about ordering of the condition.
reports()
should come first.
https://stackblitz.com/edit/solid-ssr-vite-2unf9c?file=src%2Froutes%2Findex.tsx
In comparison, without call to the resource (your described behavior):
https://stackblitz.com/edit/solid-ssr-vite-fzq4m5?file=src%2Froutes%2Findex.tsxI'll give that a shot 🙂
I have the exact same problem - any suggestions?
In what way does your problem differ that the proposed solution does not work? If you can show some code I might be able to help debug it
sure my problem is explained here - any help would be appreciated since i am new with solid in general https://discord.com/channels/722131463138705510/1145875082074407004