How to use server function & suspense
I will be frank, I have some experience with React but this is my first dive into Solid coming from Astro
I'm trying to have a fallback loading component, that is replaced by data fetched from the server when available
I figured the best way to do this was an asynchronous server function, I am not claiming there is a bug I think I just did something wrong
Here is my high-level code since I can't really share more:
7 Replies
In the future there will likely be API calls and it will be implemented differently but I'm just trying to grasp basic ideas ATM
What's the problem you're having? The only wrong thing i can see is passing the
~/assets/img
string directly into src
This doesn't work?
It just gives a "Script error" and no discernable output for me to work with
Just to be clear you are using SolidStart (which is required for
"use server"
RPC)?
Usually people throw the SolidStart tag onto the topic.Yes
Sorry I should have done that
- Created fresh SolidStart(TS) "basic" template
- Dropped the following into
src/routes/about.tsx
- Just works.
TY