Skip to content

Commit ce52d03

Browse files
authored
Remove unstable_shouldReload references (#5685)
1 parent e5c7781 commit ce52d03

File tree

5 files changed

+9
-192
lines changed

5 files changed

+9
-192
lines changed

.changeset/remove-should-reload.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@remix-run/react": major
3+
---
4+
5+
Remove `unstable_shouldReload`, which has been replaced by `shouldRevalidate`

docs/api/conventions.md

+4-14
Original file line numberDiff line numberDiff line change
@@ -190,21 +190,13 @@ title: Conventions
190190

191191
[Moved →][moved-44]
192192

193-
### unstable_shouldReload
193+
### shouldRevalidate
194194

195195
[Moved →][moved-45]
196196

197-
#### Never reloading the root
198-
199-
[Moved →][moved-46]
200-
201-
#### Ignoring search params
202-
203-
[Moved →][moved-47]
204-
205197
## Asset URL Imports
206198

207-
[Moved →][moved-48]
199+
[Moved →][moved-46]
208200

209201
[moved]: ../file-conventions/remix-config
210202
[moved-2]: ../file-conventions/remix-config#appdirectory
@@ -250,7 +242,5 @@ title: Conventions
250242
[moved-42]: ../route/catch-boundary
251243
[moved-43]: ../route/error-boundary
252244
[moved-44]: ../route/handle
253-
[moved-45]: ../route/should-reload
254-
[moved-46]: ../route/should-reload#never-reloading-the-root
255-
[moved-47]: ../route/should-reload#ignoring-search-params
256-
[moved-48]: ../other-api/asset-imports
245+
[moved-45]: ../route/should-revalidate
246+
[moved-46]: ../other-api/asset-imports

docs/route/should-reload.md

-154
This file was deleted.

packages/remix-react/index.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export type {
7373
CatchBoundaryComponent,
7474
HtmlMetaDescriptor,
7575
RouteModules as UNSAFE_RouteModules,
76-
ShouldReloadFunction,
7776
} from "./routeModules";
7877

7978
export { ScrollRestoration } from "./scroll-restoration";

packages/remix-react/routeModules.ts

-23
Original file line numberDiff line numberDiff line change
@@ -161,26 +161,3 @@ export async function loadRouteModule(
161161
});
162162
}
163163
}
164-
165-
/**
166-
* @deprecated The `unstable_shouldReload` function has been removed, so this
167-
* function will never run and route data will be revalidated on every request.
168-
* Please update the function name to `shouldRevalidate` and use the
169-
* `ShouldRevalidateFunction` interface.
170-
*/
171-
export interface ShouldReloadFunction {
172-
(args: {
173-
url: URL;
174-
prevUrl: URL;
175-
params: Params;
176-
submission?: Submission;
177-
}): boolean;
178-
}
179-
180-
interface Submission {
181-
action: string;
182-
method: string;
183-
formData: FormData;
184-
encType: string;
185-
key: string;
186-
}

0 commit comments

Comments
 (0)