相关疑难解决方法(0)

某些组件“不能用作 JSX 组件”

问题摘要:

在这个周末没有更改我的代码的情况下,一些类组件开始给我带来以下错误。

'EverySelector' cannot be used as a JSX component.
  Its element type 'ReactElement<any, any> | Component<Omit<EverySelectorProps, keyof WithTranslation>, any, any> | null' is not a valid JSX element.
    Type 'Component<Omit<EverySelectorProps, keyof WithTranslation>, any, any>' is not assignable to type 'Element | ElementClass | null'.
      Type 'Component<Omit<EverySelectorProps, keyof WithTranslation>, any, any>' is not assignable to type 'ElementClass'.
        The types returned by 'render()' are incompatible between these types.
          Type 'React.ReactNode' is not assignable to type 'import(".../node_modules/@types/react-transition-group/node_modules/@types/react/index").ReactNode'.ts(2786)
Run Code Online (Sandbox Code Playgroud)

并非每个类组件都是如此。我将在部分中展示示例Show Some Code。 …

typescript reactjs

56
推荐指数
4
解决办法
8万
查看次数

标签 统计

reactjs ×1

typescript ×1