Skip to content

Commit 6bea55a

Browse files
authored
fix: docs routeLoader (#8058)
fix docs routeLoader
1 parent 34cd17c commit 6bea55a

File tree

1 file changed

+1
-1
lines changed
  • packages/docs/src/routes/docs/(qwikcity)/route-loader

1 file changed

+1
-1
lines changed

packages/docs/src/routes/docs/(qwikcity)/route-loader/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ created_at: '2023-03-20T23:45:13Z'
2222

2323
Route Loaders load data in the server so it becomes available to use inside Qwik Components. They trigger when SPA/MPA navigation happens so they can be invoked by Qwik Components during rendering.
2424

25-
Please note that route loaders should be exported only from `layout.tsx` or `index.tsx` files. But they can be declared in any valid way ES modules allow. To reuse a route loader across multiple `layout.tsx` or `index.tsx files, define it in a separate file, export it, then import it in `layout.tsx` or `index.tsx files and [`re-export`](/docs/(qwikcity)/re-exporting-loaders/index.mdx) it as a named export.
25+
Please note that route loaders should be exported only from `layout.tsx` or `index.tsx` files. But they can be declared in any valid way ES modules allow. To reuse a route loader across multiple `layout.tsx` or `index.tsx` files, define it in a separate file, export it, then import it in `layout.tsx` or `index.tsx` files and [`re-export`](/docs/(qwikcity)/re-exporting-loaders/index.mdx) it as a named export.
2626

2727
> If you want to manage common reusable routeLoader$s it is essential that this function is re-exported from within 'layout.tsx' or 'index.tsx file of the existing route otherwise it will not run or throw exception. For more information [check this section](/docs/(qwikcity)/re-exporting-loaders/index.mdx).
2828

0 commit comments

Comments
 (0)