What is the TypeScript return type of a React stateless component?

前端 未结 5 424
情深已故
情深已故 2021-01-07 16:17

What would the return type be here?

const Foo
  : () => // ???
  = () => (
    
Foobar
)
5条回答
  •  迷失自我
    2021-01-07 16:53

    I would also add .SFC, which stands for Stateless Functional Component.

    const Foo
      : React.SFC<{}>
      = () => (
        
    Foobar
    )

提交回复
热议问题