ant-design / antd-style

css-in-js library with antd v5 token system
https://ant-design.github.io/antd-style/
MIT License
187 stars 29 forks source link

:bug: fix: fix types due to father build error #109

Closed arvinxx closed 9 months ago

arvinxx commented 9 months ago

背景

image

@types/react 最新(18.2.x)的返回是 ReactNode ,而之前的老版本则是返回的 ReactElement。当使用 IDE 版本为 ts <=5.0 时, FC 使用的类型是 ts5.0 文件夹下的 index.d.ts ,一定会走到老版本。

而 father 4.3.4 的版本加入了相应的强校验,且依赖的 ts 版本为 5.0.4 ,导致react 声明无法匹配,构建会报错。

解决方案

将类型从 ReactNode 改为 ReturnType<FC>

github-actions[bot] commented 9 months ago

😭 Deploy PR Preview 503e872afcdd58e5528ab21d5fbc2cc2a209c68f failed. Build logs

🤖 By surge-preview

github-actions[bot] commented 9 months ago

:tada: This PR is included in version 3.4.6 :tada:

The release is available on:

Your semantic-release bot :package::rocket: