Skip to content

Commit bbc33f1

Browse files
docs: add explicit import to TypeScript augmentation example (#14957)
* docs: add explicit import to TypeScript augmentation example In the "Quick Start (Data Mode)" section, the TypeScript module augmentation example for Future can cause errors if the user's .d.ts file is treated as a global script rather than a module. Without a top-level import or export, TypeScript interprets declare module "react-router" as a full ambient declaration, which shadows/overwrites the actual library types instead of augmenting them. Adding import "react-router"; ensures the file is treated as a module and triggers Module Augmentation correctly. * Add NandkishorJadoun to contributors list
1 parent 0824a52 commit bbc33f1

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,3 +486,4 @@
486486
- zeromask1337
487487
- zheng-chuang
488488
- zxTomw
489+
- NandkishorJadoun

docs/how-to/middleware.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ In order to properly type your `context` param in your `loader`/`action`/`middle
136136

137137
```ts
138138
// src/react-router.d.ts
139+
140+
import "react-router"
141+
139142
declare module "react-router" {
140143
interface Future {
141144
v8_middleware: true;

0 commit comments

Comments
 (0)