We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
想要支持组件类作为参数传给组件,一开始编写的是
组件类
// index.d.ts export interface IProps { CheckBox?: CheckBox } declare class CheckBox extends React.Component<ChexkBoxProps> { render(): JSX.Element; } // index.tsx const { CheckBox } = this.props; <CheckBox /> 引用时会提示 `JSX元素类型'CheckBox'没有任何构造或调用签名”`
查询资料得知 组件类作为参数需要如下写法
declare class CheckBox extends React.Component<ChexkBoxProps> { render(): JSX.Element; } export type CheckBoxComp = CheckBox<ChexkBoxProps>; export interface IProps { CheckBox?: CheckBoxComp; // 将组件类作为参数 }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
想要支持
组件类
作为参数传给组件,一开始编写的是查询资料得知 组件类作为参数需要如下写法
The text was updated successfully, but these errors were encountered: