-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code
Description
Code
//App.tsx
import React from 'react';
function App() {
return (
<div className="App">
<first></first>
</div>
);
}
export default App;
//first.d.ts
declare global {
namespace JSX {
interface IntrinsicElements {
first: any;
}
}
}
//tsconfig.json
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": [
"src"
]
}
Although I declare the custom element <first />
in first.d.ts
, VSCode report an error "Property 'first' does not exist on type 'JSX.IntrinsicElements'."
So I need a help to solve this problem.
Enviroment
- typescript: "4.6.2"
MartinJohns
Metadata
Metadata
Assignees
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code