Skip to content

Commit b7cdfc6

Browse files
authored
Add signal as parameter to patchRoutesOnNavigation (#12900)
1 parent 1656374 commit b7cdfc6

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

.changeset/seven-countries-divide.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@remix-run/router": minor
3+
---
4+
5+
Provide the request `signal` as a parameter to `patchRoutesOnNavigation`
6+
7+
- This can be used to abort any manifest fetches if the in-flight navigation/fetcher is aborted

packages/router/router.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3293,6 +3293,7 @@ export function createRouter(init: RouterInit): Router {
32933293
let localManifest = manifest;
32943294
try {
32953295
await patchRoutesOnNavigationImpl({
3296+
signal,
32963297
path: pathname,
32973298
matches: partialMatches,
32983299
patch: (routeId, children) => {

packages/router/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ export type AgnosticPatchRoutesOnNavigationFunctionArgs<
259259
O extends AgnosticRouteObject = AgnosticRouteObject,
260260
M extends AgnosticRouteMatch = AgnosticRouteMatch
261261
> = {
262+
signal: AbortSignal;
262263
path: string;
263264
matches: M[];
264265
patch: (routeId: string | null, children: O[]) => void;

0 commit comments

Comments
 (0)