SolidJSS
SolidJSโ€ข3y agoโ€ข
1 reply
arazorda

Is it possible for a route to have async data loader?

I want to know if it's possible for a route to have lazy import of a data function, just like in SolidStart, when you're exporting routeData .
As you can see on this screenshot, component is being lazily loaded, but the data function is not. I'm thinking about something like this -

const UserData = () => import("./pages/users/[id].data.js"


and then passing it to data={ }
so then I could retrieve the data with useRouteData

If it's not possible, what can be done to achieve something like this?
Screenshot_2023-03-29_at_3.55.06_AM.png
Was this page helpful?