File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -966,6 +966,20 @@ function foo(bar: string) {
966
966
// inside your app, if you need { baz : number }
967
967
type FooReturn = ReturnType<typeof foo >; // { baz : number }
968
968
```
969
+ # Troubleshooting Handbook: Images and other non-TS/TSX files
970
+
971
+ Use [declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html):
972
+
973
+ ```ts
974
+ // declaration.d.ts
975
+ // anywhere in your project, NOT the same name as any of your .ts/tsx files
976
+ declare module '*.png'
977
+
978
+ // importing in a tsx file
979
+ import * as logo from "./logo.png";
980
+ ```
981
+
982
+ Related issue: https://github.com/Microsoft/TypeScript-React-Starter/issues/12 and [StackOverflow](https://stackoverflow.com/a/49715468/4216035)
969
983
970
984
# Troubleshooting Handbook: TSLint
971
985
You can’t perform that action at this time.
0 commit comments