0
引数として渡された反応コンポーネントをレンダリングする関数を記述します。 Component
とStatelessComponent
の両方のタイプを処理したいと思います。Typescript、JSX:引数として渡されるコンポーネントをレンダリングする
error TS2604: JSX element type 'component' does not have any construct or call signatures.
私が間違っているのは何:
function renderComponent(component: React.ComponentClass<any> | React.StatelessComponent<any>) {
return <component />;
}
私はコンパイルエラーを得た:これは私がそれを行う方法ですか?