You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/gotchas.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ if (typeof window === "undefined") {
20
20
}
21
21
```
22
22
23
-
This works fine in a Node.js environment, however, Deno actually supports`window`! So if you really want to check whether you're running in the browser, it's better to check for `document` instead:
23
+
This works fine in a Node.js environment, however, some environments might actually support`window` (like Deno v1), so if you really want to check whether you're running in the browser, it's better to check for `document` instead:
The above configuration parses the markdown to insert [highlight.js][highlightjs] friendly DOM elements. To have the syntax highlighting appear, you will also need to include the highlight.js css file. See also [surfacing styles][surfacing-styles].
Copy file name to clipboardExpand all lines: docs/hooks/use-fetcher.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,6 +112,8 @@ fetcher.submit(
112
112
113
113
Loads data from a route loader. While multiple nested routes can match a URL, only the leaf route will be called.
114
114
115
+
Note that when calling `load` on an index route's loader, you must include an [`?index` query param][index-query-param] in order to disambiguate between the `index.tsx` layout and the `root.tsx` route.
116
+
115
117
```ts
116
118
fetcher.load("/some/route");
117
119
fetcher.load("/some/route?foo=bar");
@@ -180,3 +182,4 @@ The form method of the submission.
Copy file name to clipboardExpand all lines: docs/hooks/use-revalidator.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,16 +40,17 @@ Initiates a revalidation.
40
40
```tsx
41
41
function useLivePageData() {
42
42
const revalidator =useRevalidator();
43
-
const interval =useInterval(5000);
44
43
45
-
useEffect(() => {
44
+
useInterval(() => {
46
45
if (revalidator.state==="idle") {
47
46
revalidator.revalidate();
48
47
}
49
-
}, [interval, revalidator]);
48
+
}, 5000);
50
49
}
51
50
```
52
51
52
+
See [here][here] for a sample `useInterval` implementation.
53
+
53
54
## Notes
54
55
55
56
While you can render multiple occurrences of `useRevalidator` at the same time, underneath it is a singleton. This means when one `revalidator.revalidate()` is called, all instances go into the `"loading"` state together (or rather, they all update to report the singleton state).
@@ -61,3 +62,4 @@ If a navigation happens while a revalidation is in flight, the revalidation will
0 commit comments