Created
December 9, 2018 01:27
-
-
Save magic-akari/cfc0e1c31ddcc5dd4a2f07a5da4725dc to your computer and use it in GitHub Desktop.
tsc bug demo 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules | |
dist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("hello"); | |
React.createRef; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare global { | |
const React: typeof import("./module"); | |
} | |
export {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/e95e11dcf2afe422e9044bbdb0e926b1647fbf9e/types/react/index.d.ts#L44-L47 | |
export = React; | |
export as namespace React; | |
declare namespace React { | |
function createRef(): any; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"private": true, | |
"license": "MIT", | |
"scripts": { | |
"start": "tsc" | |
}, | |
"devDependencies": { | |
"typescript": "3.3.0-dev.20181208" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"target": "es2018", | |
"module": "esnext", | |
"jsx": "react", | |
"strict": true, | |
"moduleResolution": "node", | |
"esModuleInterop": true, | |
"outDir": "dist" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment