What does the error “JSX element type '…' does not have any construct or call signatures” mean?

后端 未结 13 2287
余生分开走
余生分开走 2020-11-28 02:05

I wrote some code:

function renderGreeting(Elem: React.Component) {
    return Hello, !;
}
         


        
13条回答
  •  隐瞒了意图╮
    2020-11-28 02:39

    If you want to take a component class as a parameter (vs an instance), use React.ComponentClass:

    function renderGreeting(Elem: React.ComponentClass) {
        return Hello, !;
    }
    

提交回复
热议问题