Skip to content

Commit b39d99b

Browse files
Merge branch 'main' into request-event-locals
2 parents 2b579dc + 890dafa commit b39d99b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/routes/solid-start/building-your-application/data-loading.mdx

+5-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ It takes an async function and returns a [signal](/reference/basic-reactivity/cr
1414

1515
<TabsCodeBlocks>
1616
<div id="ts">
17-
```tsx {6-9}
17+
```tsx {6-9} title="/src/routes/users.tsx"
1818
import { For, createResource } from "solid-js";
1919

2020
type User = { name: string; house: string };
@@ -30,7 +30,7 @@ export default function Page() {
3030
```
3131
</div>
3232
<div id="js">
33-
```tsx {4-7}
33+
```tsx {4-7} title="/src/routes/users.jsx"
3434
import { For, createResource } from "solid-js";
3535

3636
export default function Page() {
@@ -46,11 +46,8 @@ export default function Page() {
4646
</TabsCodeBlocks>
4747

4848
When fetching inside components, you can encounter unnecessary waterfalls, especially when nested under lazy loaded sections.
49-
To solve this, it can be valuable to introduce a hoist and cache mechanism.
50-
51-
Using a library like [Tanstack Query](https://tanstack.com/query/latest) can help with this.
52-
53-
for the example below we will be using the data in APIs in [`solid-router`](/solid-router)
49+
To solve this, it is recommended to hoist the data fetching to the top of the component tree or, when in [SolidStart](/solid-start), use the server to fetch data in a non-blocking way.
50+
For the example below we will be using the data in APIs in [`solid-router`](/solid-router)
5451

5552
Using some of the features of `solid-router`, we can create a cache for our data:
5653

@@ -78,6 +75,7 @@ export default function Page() {
7875
}
7976
```
8077
</div>
78+
8179
<div id="js">
8280
```tsx title="/routes/users.jsx" {4, 7, 10}
8381
import { For } from "solid-js";

0 commit comments

Comments
 (0)