Open
Description
When trying to emit declarations for a React package, tsgo requires type annotations for React Components.
Example component being used:
/* src/index.tsx */
export const MyComponent = () => {
return <div>Hello World</div>
}
tsconfig.json
being used:
{
"include": ["src/**/*.ts", "src/**/*.tsx"],
"exclude": ["node_modules"],
"compilerOptions": {
"target": "es6",
"jsx": "react-jsx",
"forceConsistentCasingInFileNames": true,
"noEmit": false,
"esModuleInterop": true,
"incremental": false,
"isolatedModules": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true
}
}
Command:
tsgo -p tsconfig.json --emitDeclarationOnly --declaration --outDir out
The following command produces:
The inferred type of 'MyComponent' cannot be named without a reference to '../node_modules/@types/react/jsx-runtime.js'. This is likely not portable. A type annotation is necessary.
Running the same with tsc
produces no errors.