报错信息:TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.
报错起因:在应用typescript的时候,在vue或react、node中报以上谬误,是JSX 元素隐式具备类型 "any",因为不存在全局类型 "JSX.Element"。
解决办法:
第一种:
不应用严格的类型查看,即在 tsconfig.json 中设置 "strict": false
在 tsconfig.json中设置 "noImplicitThis": false
"noImplicitAny": false, // 是否在表达式和申明上有隐含的any类型时报错
第二种:
{ "compilerOptions": { "noImplicitAny": false, // 是否在表达式和申明上有隐含的any类型时报错 }}
tsconfig.json 的配置选项可查看官网文档