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(components): [Input] input's row props that are not declared in the typefile and fix return value Many<T>[] not matching the type of T[] #16390
Changes from all commits
08bbc1a
9393157
008d3d9
ec2fd9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ type Many<T> = T | ReadonlyArray<T> | |
/** like `_.castArray`, except falsy value returns empty array. */ | ||
export const castArray = <T>(arr: Many<T>): T[] => { | ||
if (!arr && (arr as any) !== 0) return [] | ||
return Array.isArray(arr) ? arr : [arr] | ||
return Array.isArray(arr) ? (arr as T[]) : [arr as T] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There seems to be no problem under the ts version that the code currently depends on, and it may not need to be modified. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. great There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i learn from it |
||
} | ||
|
||
// TODO: remove import alias | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to set the rows prop here. The native textarea supports setting rows directly, and attrs is also directly bound in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tanks a lot. this problem may exist the ide and my version of ts