Skip to content

Instantly share code, notes, and snippets.

@magic-akari
Created December 9, 2018 01:27
Show Gist options
  • Save magic-akari/cfc0e1c31ddcc5dd4a2f07a5da4725dc to your computer and use it in GitHub Desktop.
Save magic-akari/cfc0e1c31ddcc5dd4a2f07a5da4725dc to your computer and use it in GitHub Desktop.
tsc bug demo 2
node_modules
dist
console.log("hello");
React.createRef;
declare global {
const React: typeof import("./module");
}
export {};
// 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;
}
{
"private": true,
"license": "MIT",
"scripts": {
"start": "tsc"
},
"devDependencies": {
"typescript": "3.3.0-dev.20181208"
}
}
{
"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