S
SolidJS•2y ago
aquarazorda

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"
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?
1 Reply
aquarazorda
aquarazorda•2y ago
🤔
Want results from more Discord servers?
Add your server