Created by: daceynolan
This PR includes a documentation update to note that the src/global.d.ts
is recognized by default for type declarations.
Added to the docs so others that come across this find the solution in the official docs.
While working with TypeScript and create-react-app, I ran into a scenario where I needed to declare an ambient module. I created a src/types.d.ts
file to declare my module only to find out that the file is not recognized.
Through my research, I found this issue: https://github.com/facebook/create-react-app/issues/6553
The suggestion was to modify the tsconfig
which didn't seem like a great solution.
Found this thread: https://stackoverflow.com/questions/54949876/create-react-app-typescript-does-not-load-d-ts-file
That thread recommended using a src/global.d.ts
file which solved my problem.