Property XXX does not exist on type 'JSX.IntrinsicElements'

今天TSX文件报错内容如标题,经过查证才知道组件的命名要首字母大写,示例代码如下:

import React from "react";
import Condition from './Condition';
interface propsTypes {
}
function KeyWordDom(props:propsTypes){
return (<>
         <Condition></Condition>
        </>
        )
}

const keyWord = React.forwardRef((props: any, ref: any) => {
  return <KeyWordDom {...props} myRef={ref}></KeyWordDom>;
});
export default keyWord;

如果keywordDom的K是小写的就会报如标题错误

posted @ 2020-09-30 17:42  洛晨随风  阅读(3778)  评论(0编辑  收藏  举报