Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Sep 15, 2023
Merged

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

merged 1 commit into from
Sep 15, 2023

Conversation

arvinxx
Copy link
Collaborator

@arvinxx arvinxx commented Sep 15, 2023

背景

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
Copy link

github-actions bot commented Sep 15, 2023

😭 Deploy PR Preview 503e872 failed. Build logs

🤖 By surge-preview

@arvinxx arvinxx merged commit 9bf726e into master Sep 15, 2023
4 checks passed
@arvinxx arvinxx deleted the fix/types branch September 15, 2023 07:42
github-actions bot pushed a commit that referenced this pull request Sep 15, 2023
## [3.4.6](v3.4.5...v3.4.6) (2023-09-15)

### 🐛 Bug Fixes

* Fix types due to father lock ts version, closes [#109](#109) ([9bf726e](9bf726e))
@github-actions
Copy link

🎉 This PR is included in version 3.4.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant