Skip to content

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Mar 15, 2022

@vercel
Copy link

vercel bot commented Mar 15, 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/5gkWcgpDg7n3osFHZ6YyVHNYsB6y
✅ Preview: https://select-git-fix-onselect-type-react-component.vercel.app

@codecov
Copy link

codecov bot commented Mar 15, 2022

Codecov Report

Merging #726 (71e20e8) into master (e08c7ce) will not change coverage.
The diff coverage is n/a.

❗ Current head 71e20e8 differs from pull request most recent head c22beab. Consider uploading reports for the commit c22beab to get more accurate results

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

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@zombieJ zombieJ merged commit 22e5fab into master Mar 15, 2022
@zombieJ zombieJ deleted the fix-onSelect-type branch March 15, 2022 02:34
@KAROTT7
Copy link

KAROTT7 commented Mar 19, 2022

问题还没有修复!!
复现案例: https://codesandbox.io/s/rc-select-onselect-type-error-7d5s2d?file=/src/App.tsx

问题在于 SelectHander 类型定义

export type SelectHandler<ValueType = any, OptionType extends BaseOptionType = DefaultOptionType> =
  | ((value: RawValueType | LabelInValueType, option: OptionType) => void)
  | ((value: ValueType, option: OptionType) => void);

可以改成

export type SelectHandler<ValueType, OptionType> =
  ((value: ValueType, option: OptionType) => void);

@afc163
Copy link
Member

afc163 commented Mar 19, 2022

@KAROTT7 欢迎 PR

@KAROTT7
Copy link

KAROTT7 commented Mar 19, 2022

已经提交 PR

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.

Incorrect Typescript Type For Multiple Select
3 participants