Closed alex-golubtsov closed 1 year ago
Thanks for your issuing, could your please show me a codesandbox to debug it? I try with @types/react^18
,it seems work well.
if you check the types in @types/react@18, you will see FunctionComponent ( alias of FC ) return ReactNode (Line 553).
antd-style 's peerDeps is:
"peerDependencies": {
"react": ">=18"
}
So I think it's not a bug.
@arvinxx currently @types/react
uses ts5.0 types. I don't understand why they do it even for ts versions < 5, but that's how it is. And there is ReactElement
instead of ReactNode
.
Probably worth to investigate. Which version of @types/react
do you rely on? Bet it's < 18.0.37
Which version of @types/react do you rely on? Bet it's < 18.0.37
@alex-golubtsov latest, 18.2.8: https://unpkg.com/browse/@types/react@18.2.8/index.d.ts
Which version of @types/react do you rely on? Bet it's < 18.0.37
@alex-golubtsov latest, 18.2.8: https://unpkg.com/browse/@types/react@18.2.8/index.d.ts
@arvinxx thanks for the clarification! It finally works with typescript ^5
This change breaks
ThemeProvider
rendering.Demo:
It makes perfect sense, since
ReactNode
cannot be returned byReact.FC