Skip to content

Commit

Permalink
Fix lazy loading example (#983)
Browse files Browse the repository at this point in the history
  • Loading branch information
snnsnn authored Dec 30, 2024
1 parent 828abd7 commit 17509cd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/routes/solid-router/advanced-concepts/lazy-loading.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ In Solid Router, you can lazy load components using the `lazy` function from Sol
import { lazy } from "solid-js";
import { Router, Route } from "@solidjs/router";

const Home = () => import("./Home");
const Home = lazy(() => import("./Home"));

const Users = lazy(() => import("./Users"));

const App = () => (
<Router>
<Route path="/" component={<Home />} />
<Route path="/users" component={<Users />} />
<Route path="/" component={Home} />
<Route path="/users" component={Users} />
</Router>
);
```
Expand Down

0 comments on commit 17509cd

Please sign in to comment.