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

chore: fixed InternalTreeSelect's generic signature #41386

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Mar 21, 2023

The declared signature doesn't match the one to which it is casted later on:

const TreeSelectRef = React.forwardRef(InternalTreeSelect) as <
ValueType = any,
OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType,
>(
props: React.PropsWithChildren<TreeSelectProps<ValueType, OptionType>> & {
ref?: React.Ref<BaseSelectRef>;
},
) => React.ReactElement;

This should be a type error but currently, it's accidentally swallowed by TS. Notice how the problem is reported in this TS playground and how it goes away when you include the commented out property.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 21, 2023

@codecov
Copy link

codecov bot commented Mar 21, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (f7fd474) 100.00% compared to head (cb3ddca) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #41386   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          610       610           
  Lines        10453     10453           
  Branches      2851      2851           
=========================================
  Hits         10453     10453           
Impacted Files Coverage Δ
components/tree-select/index.tsx 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@li-jia-nan li-jia-nan merged commit 676a170 into ant-design:master Mar 22, 2023
RedJue pushed a commit to RedJue/ant-design that referenced this pull request Apr 25, 2023
RedJue pushed a commit to RedJue/ant-design that referenced this pull request Apr 25, 2023
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.

2 participants