chore: prefer using type-compatible-assigning over using type-assertion (#36694)

This commit is contained in:
Zheeeng 2022-07-26 11:25:45 +08:00 committed by GitHub
parent 16d2c5def3
commit b89ed86698
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,13 +74,13 @@ const Password = React.forwardRef<InputRef, PasswordProps>((props, ref) => {
[`${prefixCls}-${size}`]: !!size,
});
const omittedProps = {
const omittedProps: InputProps = {
...omit(restProps, ['suffix', 'iconRender']),
type: visible ? 'text' : 'password',
className: inputClassName,
prefixCls: inputPrefixCls,
suffix: suffixIcon,
} as InputProps;
};
if (size) {
omittedProps.size = size;