Skip to content

Conversation

MadCcc
Copy link
Member

@MadCcc MadCcc commented Jan 6, 2022

@vercel
Copy link

vercel bot commented Jan 6, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/select/9Gjg3B2QjTSzPWRQx4UiJtD1sdbq
✅ Preview: https://select-git-fixselecttype-react-component.vercel.app

@codecov
Copy link

codecov bot commented Jan 6, 2022

Codecov Report

Merging #704 (bad2b39) into master (3b94e1b) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #704   +/-   ##
=======================================
  Coverage   99.50%   99.50%           
=======================================
  Files          25       25           
  Lines        1012     1012           
  Branches      321      321           
=======================================
  Hits         1007     1007           
  Misses          4        4           
  Partials        1        1           
Impacted Files Coverage Δ
src/Select.tsx 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b94e1b...bad2b39. Read the comment docs.

@MadCcc
Copy link
Member Author

MadCcc commented Jan 6, 2022

可以绕过 strictFunctionTypes 的检查,算是一个 hack。。。
如果要完全符合 strict 标准的话可能需要把整个类型都统一一下,包括把泛型传下去。
这个解决方案的一个缺点就是让 ts 自己推断类型的话会变的有些难以理解:
image

@zombieJ @afc163

@MadCcc MadCcc merged commit 3bf208b into master Jan 6, 2022
@MadCcc MadCcc deleted the fix_select_type branch January 6, 2022 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Breaking change: Select#onSelect type forces us to comply with weird union type

2 participants