Skip to content

Commit 9fde466

Browse files
authored
fix(react-router): remove dependency on @types/node in TypeScript declaration files (#14059)
1 parent 94f345a commit 9fde466

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

.changeset/shiny-owls-glow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
Remove dependency on `@types/node` in TypeScript declaration files

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@
247247
- mcansh
248248
- MeatSim
249249
- MenouerBetty
250+
- Methuselah96
250251
- mfijas
251252
- MichaelDeBoey
252253
- michal-antczak

packages/react-router/lib/rsc/server.rsc.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,9 @@ type ServerContext = {
6969
redirect?: Response;
7070
};
7171

72-
declare global {
73-
var ___reactRouterServerStorage___:
74-
| AsyncLocalStorage<ServerContext>
75-
| undefined;
76-
}
77-
78-
const globalVar = typeof globalThis !== "undefined" ? globalThis : global;
72+
const globalVar = (typeof globalThis !== "undefined" ? globalThis : global) as {
73+
___reactRouterServerStorage___?: AsyncLocalStorage<ServerContext>;
74+
};
7975

8076
const ServerStorage = (globalVar.___reactRouterServerStorage___ ??=
8177
new AsyncLocalStorage<ServerContext>());

0 commit comments

Comments
 (0)