SolidStart is it possible to make `load` function on Solid Router async?
My code seems to be working already but I still can't use the data that was loaded as a data that can be used for hydration. (It's not on the returned .html)
I followed the instructions on here: https://github.com/solidjs/solid-router?tab=readme-ov-file#data-functions--useroutedata
Any tips on this?
GitHub
GitHub - solidjs/solid-router: A universal router for Solid inspire...
A universal router for Solid inspired by Ember and React Router - solidjs/solid-router
3 Replies
having a bit difficulty understanding the question
is the issue that
props.data
is empty?
or that there is nothing server side rendered?
I see you are using server-specific code in the load-function, this would need a "use server"
directive.
this might be relevant to u https://discord.com/channels/722131463138705510/1249411705646354434/1249434295479566366This works fine:
Remember that you need to disable preloading:
It's not on the returned .htmlThat's because SoildStart sends streaming responses. If you want it to wait, use
{ deferStream: true }
on the resource:
Thanks @peerreynders ! Yup that did the trick. Thanks!
Sorry if the question wasn't clear btw.