Skip to content

Commit

Permalink
docs: Update index.mdx (QwikDev#3648)
Browse files Browse the repository at this point in the history
  • Loading branch information
hamatoyogi authored Apr 4, 2023
1 parent 4870851 commit 3a39ac6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default component$(() => {
});
```

> It may appear that `useGetServerTime()` initiates the retrieval of the server data when the component renders. But in reality, the `routeLoader$` associated with `useGetServerTime` gets executed eagerly at HTTP request. In this way, the asynchronous work of fetching server data can initiate as early as possible. (`routeLoader$` function invokes eagerly on HTTP request regardless of whether `useGetServerTime()` is invoked in the component.) For this reason, they are only allowed in the `src/routes` folder, in a `layout.tsx` or `index.tsx` files.
> It may appear that `useProductData()` initiates the retrieval of the server data when the component renders. But in reality, the `routeLoader$` associated with `useProductData` gets executed eagerly at HTTP request. In this way, the asynchronous work of fetching server data can initiate as early as possible. (`routeLoader$` function invokes eagerly on HTTP request regardless of whether `useProductData()` is invoked in the component.) For this reason, they are only allowed in the `src/routes` folder, in a `layout.tsx` or `index.tsx` files.
## Multiple `routeLoader$`s

Expand Down

0 comments on commit 3a39ac6

Please sign in to comment.