TypeScript 3: JSX element type 'Component' does not have any construct or call signatures. [2604]

后端 未结 5 868
挽巷
挽巷 2021-02-07 10:06

I\'m trying to pass a variable of type React.Component (or React.FunctionComponent) into a Route, like this:

import React from \'react\';
import { Route } from \         


        
5条回答
  •  没有蜡笔的小新
    2021-02-07 10:30

    I was able to resolve the error by typing my component as follows:

    ...
    export function withApollo (PageComponent: () => JSX.Element) {
    const WithApollo = (props: T) => {
    ...
    

提交回复
热议问题