SolidJSS
SolidJSโ€ข3y agoโ€ข
27 replies
Vexcited

How can we lazy load route data using @solidjs/router ?

When using this pattern:

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

// In the Route definition
<Route path="/users/:id" component={User} data={UserData} />;


Here, the
User
component is lazy loaded but what about the UserData ?

Is there a way to do that?
Was this page helpful?