Skip to content

Commit 17509cd

Browse files
authored
Fix lazy loading example (#983)
1 parent 828abd7 commit 17509cd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/routes/solid-router/advanced-concepts/lazy-loading.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ In Solid Router, you can lazy load components using the `lazy` function from Sol
1111
import { lazy } from "solid-js";
1212
import { Router, Route } from "@solidjs/router";
1313

14-
const Home = () => import("./Home");
14+
const Home = lazy(() => import("./Home"));
15+
1516
const Users = lazy(() => import("./Users"));
17+
1618
const App = () => (
1719
<Router>
18-
<Route path="/" component={<Home />} />
19-
<Route path="/users" component={<Users />} />
20+
<Route path="/" component={Home} />
21+
<Route path="/users" component={Users} />
2022
</Router>
2123
);
2224
```

0 commit comments

Comments
 (0)