JSX element type does not have any construct or call signatures. Typescript

后端 未结 3 612
情话喂你
情话喂你 2021-01-18 06:10

In case compose is used there is an error JSX element type ‘Option’ does not have any construct or call signatures. \'redux\' version - 3.7.2

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-18 06:22

    You need to type cast the component returned by compose as React.ComponentType and it works fine. So:

    compose(...)(SomeComponent) as React.ComponentType
    

提交回复
热议问题