![](/img/trans.png)
[英]Why: Type 'React.ReactNode' is not assignable to type.. ReactNode
[英]Type 'React.ReactNode' is not assignable to type 'import(".../@types/react-transition-group/node_modules/@types/react/index").ReactNode'
我使用過 React 項目,與 Circle CI 集成,經過一些小的更改后,它開始使所有構建失敗
Its instance type 'ReactApexChart' is not a valid JSX element.
The types returned by 'render()' are incompatible between these types.
Type 'React.ReactNode' is not assignable to type 'import("/home/circleci/app.mxney-board-v2.test/node_modules/@types/react-transition-group/node_modules/@types/react/index").ReactNode'.
79 <Chart options={fillOptions} series={graphData} height={chartHeight} />
~~~~~
src/index.tsx:20:8 - error TS2786: 'App' cannot be used as a JSX component.
Its element type 'ReactElement<any, any> | Component<Omit<Subtract<unknown, WithTranslationProps>, keyof WithTranslation<N>> & WithTranslationProps, any, any> | null' is not a valid JSX element.
Type 'Component<Omit<Subtract<unknown, WithTranslationProps>, keyof WithTranslation<N>> & WithTranslationProps, any, any>' is not assignable to type 'Element | ElementClass | null'.
Type 'Component<Omit<Subtract<unknown, WithTranslationProps>, keyof WithTranslation<N>> & WithTranslationProps, 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("/home/circleci/app.mxney-board-v2.test/node_modules/@types/react-transition-group/node_modules/@types/react/index").ReactNode'.
20 <App />
~~~
在本地,項目運行沒有問題。
我試過了:
您的@types/react
是否與您安裝的 react 版本匹配?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.