File tree 2 files changed +7
-7
lines changed
packages/react-router/lib/dom/ssr
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " react-router " : patch
3
+ ---
4
+
5
+ Remove ` Navigator ` declaration for ` navigator.connection.saveData ` to avoid messing with any other types beyond ` saveData ` in userland
Original file line number Diff line number Diff line change @@ -9,12 +9,6 @@ import type { EntryRoute } from "./routes";
9
9
import { createClientRoutes } from "./routes" ;
10
10
import type { ServerBuild } from "../../server-runtime/build" ;
11
11
12
- declare global {
13
- interface Navigator {
14
- connection ?: { saveData : boolean } ;
15
- }
16
- }
17
-
18
12
// Currently rendered links that may need prefetching
19
13
const nextPaths = new Set < string > ( ) ;
20
14
@@ -115,7 +109,8 @@ export function useFogOFWarDiscovery(
115
109
// Don't prefetch if not enabled or if the user has `saveData` enabled
116
110
if (
117
111
! isFogOfWarEnabled ( routeDiscovery , ssr ) ||
118
- navigator . connection ?. saveData === true
112
+ // @ts -expect-error - TS doesn't know about this yet
113
+ window . navigator ?. connection ?. saveData === true
119
114
) {
120
115
return ;
121
116
}
You can’t perform that action at this time.
0 commit comments