Skip to content

Commit

Permalink
feat(remix-react)!: remove unstable_shouldReload references (#6865)
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 authored Jul 20, 2023
1 parent f4c842d commit c7fffe8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 185 deletions.
5 changes: 5 additions & 0 deletions .changeset/remove-unstable-should-reload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/react": major
---

Remove `unstable_shouldReload`, which has been replaced by `shouldRevalidate`
7 changes: 0 additions & 7 deletions docs/api/conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,6 @@ title: Conventions

[Moved →][moved-44]

### unstable_shouldReload

[Moved →][moved-45]

#### Never reloading the root

[Moved →][moved-46]
Expand Down Expand Up @@ -250,7 +246,4 @@ title: Conventions
[moved-42]: ../route/catch-boundary
[moved-43]: ../route/error-boundary
[moved-44]: ../route/handle
[moved-45]: ../route/should-reload
[moved-46]: ../route/should-reload#never-reloading-the-root
[moved-47]: ../route/should-reload#ignoring-search-params
[moved-48]: ../other-api/asset-imports
154 changes: 0 additions & 154 deletions docs/route/should-reload.md

This file was deleted.

1 change: 0 additions & 1 deletion packages/remix-react/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ export type {
V2_MetaDescriptor,
V2_MetaFunction,
RouteModules as UNSAFE_RouteModules,
ShouldReloadFunction,
} from "./routeModules";

export { ScrollRestoration } from "./scroll-restoration";
Expand Down
23 changes: 0 additions & 23 deletions packages/remix-react/routeModules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,26 +205,3 @@ export async function loadRouteModule(
});
}
}

/**
* @deprecated The `unstable_shouldReload` function has been removed, so this
* function will never run and route data will be revalidated on every request.
* Please update the function name to `shouldRevalidate` and use the
* `ShouldRevalidateFunction` interface.
*/
export interface ShouldReloadFunction {
(args: {
url: URL;
prevUrl: URL;
params: Params;
submission?: Submission;
}): boolean;
}

interface Submission {
action: string;
method: string;
formData: FormData;
encType: string;
key: string;
}

0 comments on commit c7fffe8

Please sign in to comment.