Skip to content

Commit dad82b1

Browse files
committed
refactor: _internalSetRoutes
1 parent d3dc6e8 commit dad82b1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/react-router-dom/server.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ export function createStaticRouter(
306306
},
307307
_internalFetchControllers: new Map(),
308308
_internalActiveDeferreds: new Map(),
309+
_internalSetRoutes() {
310+
throw msg("_internalSetRoutesAndRevalidate");
311+
},
309312
};
310313
}
311314

packages/router/router.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export interface Router {
218218
* HMR needs to pass in-flight route updates to React Router
219219
* TODO: Replace this with granular route update APIs (addRoute, updateRoute, deleteRoute)
220220
*/
221-
_internalSetRoutesAndRevalidate(routes: AgnosticRouteObject[]): void;
221+
_internalSetRoutes(routes: AgnosticRouteObject[]): void;
222222

223223
/**
224224
* @internal
@@ -2290,11 +2290,8 @@ export function createRouter(init: RouterInit): Router {
22902290
return null;
22912291
}
22922292

2293-
function _internalSetRoutesAndRevalidate(
2294-
newRoutes: AgnosticDataRouteObject[]
2295-
) {
2293+
function _internalSetRoutes(newRoutes: AgnosticDataRouteObject[]) {
22962294
inFlightDataRoutes = newRoutes;
2297-
revalidate();
22982295
}
22992296

23002297
router = {
@@ -2326,7 +2323,7 @@ export function createRouter(init: RouterInit): Router {
23262323
_internalActiveDeferreds: activeDeferreds,
23272324
// TODO: Remove setRoutes, it's temporary to avoid dealing with
23282325
// updating the tree while validating the update algorithm.
2329-
_internalSetRoutesAndRevalidate,
2326+
_internalSetRoutes,
23302327
};
23312328

23322329
return router;

0 commit comments

Comments
 (0)