Skip to content

Commit f96433f

Browse files
committed
Fix useRevalidator example
1 parent 6a3c243 commit f96433f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

packages/react-router/lib/hooks.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,14 @@ export function useNavigation(): Navigation {
11961196
}
11971197

11981198
/**
1199-
* Revalidate the data on the page for reasons outside of normal data mutations like window focus or polling on an interval.
1199+
* Revalidate the data on the page for reasons outside of normal data mutations
1200+
* like window focus or polling on an interval.
1201+
*
1202+
* Note that page data is already revalidated automatically after actions.
1203+
* If you find yourself using this for normal CRUD operations on your data in
1204+
* response to user interactions, you're probably not taking advantage of the
1205+
* other APIs like {@link useFetcher}, {@link Form}, {@link useSubmit} that do
1206+
* this automatically.
12001207
*
12011208
* @example
12021209
* import { useRevalidator } from "react-router";
@@ -1215,8 +1222,6 @@ export function useNavigation(): Navigation {
12151222
* );
12161223
* }
12171224
*
1218-
* Note that page data is already revalidated automatically after actions. If you find yourself using this for normal CRUD operations on your data in response to user interactions, you're probably not taking advantage of the other APIs like {@link useFetcher}, {@link Form}, {@link useSubmit} that do this automatically.
1219-
*
12201225
* @public
12211226
* @category Hooks
12221227
* @mode framework

scripts/docs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ function simplifyComment(
536536
let name = getApiName(comment);
537537
let unstable = name.startsWith("unstable_");
538538

539-
let codeLink = `https://github.com/remix-run/react-router/blob/main/${filepath}#L${comment.line}`;
539+
let codeLink = `https://github.com/remix-run/react-router/blob/main/${filepath}`;
540540

541541
let categoryTags = comment.tags.filter((t) => t.type === "category");
542542
if (categoryTags.length !== 1) {

0 commit comments

Comments
 (0)