JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicEle 翻译过来就是JSX 元素隐式具有类型 “any“,因为不存在接口 “JSX.IntrinsicElements“
解决的办法有二种:
- 不使用严格的类型检查,即在 tsconfig.json 中设置 “strict”: false
{
"compilerOptions": {
"strict": false
}
}
- 在 tsconfig.json中设置 “noImplicitThis”: false
{
"compilerOptions": {
"noImplicitAny": false, // 是否在表达式和声明上有隐含的any类型时报错
}
}