Skip to content

Commit 0b49844

Browse files
committed
fix a few useRevalidate->useRevalidator typos
1 parent 5ff7203 commit 0b49844

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.changeset/revalidate-error-boundary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"react-router": patch
33
---
44

5-
Allow `useRevalidate()` to resolve a loader-driven error boundary scenario
5+
Allow `useRevalidator()` to resolve a loader-driven error boundary scenario

packages/react-router/__tests__/data-memory-router-test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ describe("createMemoryRouter", () => {
909909
});
910910
});
911911

912-
it("reloads data using useRevalidate", async () => {
912+
it("reloads data using useRevalidator", async () => {
913913
let count = 1;
914914
let router = createMemoryRouter(
915915
createRoutesFromElements(

packages/router/router.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ export function createRouter(init: RouterInit): Router {
790790

791791
// Use this internal flag to force revalidation of all loaders:
792792
// - submissions (completed or interrupted)
793-
// - useRevalidate()
793+
// - useRevalidator()
794794
// - X-Remix-Revalidate (from redirect)
795795
let isRevalidationRequired = false;
796796

@@ -3263,7 +3263,7 @@ function getMatchesToLoad(
32633263
...submission,
32643264
actionResult,
32653265
defaultShouldRevalidate:
3266-
// Forced revalidation due to submission, useRevalidate, or X-Remix-Revalidate
3266+
// Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate
32673267
isRevalidationRequired ||
32683268
// Clicked the same link, resubmitted a GET form
32693269
currentUrl.toString() === nextUrl.toString() ||
@@ -3322,7 +3322,7 @@ function getMatchesToLoad(
33223322
nextParams: matches[matches.length - 1].params,
33233323
...submission,
33243324
actionResult,
3325-
// Forced revalidation due to submission, useRevalidate, or X-Remix-Revalidate
3325+
// Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate
33263326
defaultShouldRevalidate: isRevalidationRequired,
33273327
});
33283328
if (shouldRevalidate) {

0 commit comments

Comments
 (0)