alrightsure
Explore posts from serversTop level "use server" doesn't seem to work
Hey all, I've noticed that I put "use server" at the top of the file, it doesn't seem to actually treat the functions in the file as server functions, and the actions don't work as expected.
I wanted to ask here before filing an issue, as I feel like maybe I am misunderstanding.
For example, this seems to work:
However, this throws an error when I try to call these functions:
Is this intended behavior?
6 replies
useRouteData empty on HMR
I'm just curious about the expected behavior of useRouteData in Solid Start. It seems to return an empty response after HMR, but only in certain situations. I created two identical pages with different route data functions. One pulls from the Pokemon API and another accesses my firestore instance:
The Pokemon page seems to persist data through HMRs, however, my route data from firestore seems to be empty after an HMR. Does anyone have any insight into this?
3 replies
Calling database with server actions in Solid Start
Hey all, I have a question more about best practices than anything. In the Solid Start docs, under the Server Actions heading, it says the following:
My question is why this may be considered a bad idea, especially when it's not frowned upon in createServerData$.
8 replies