type: ref type optimization (#43703)

Co-authored-by: 我们去月球漫步 <13105694+flymetothemoon-wj@user.noreply.gitee.com>
This commit is contained in:
Fly me to the moon 2023-07-21 15:49:16 +08:00 committed by GitHub
parent c831145cf4
commit ab8e10d2c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 9 deletions

View File

@ -64,13 +64,7 @@ const LoadingIcon: React.FC<LoadingIconProps> = (props) => {
onLeaveStart={getRealWidth}
onLeaveActive={getCollapsedWidth}
>
{(
{
className: motionCls,
style: motionStyle,
}: { className?: string; style?: React.CSSProperties },
ref: any,
) => (
{({ className: motionCls, style: motionStyle }, ref: React.Ref<HTMLSpanElement>) => (
<InnerLoadingIcon
prefixCls={prefixCls}
className={className}

View File

@ -85,12 +85,12 @@ const FloatButton: React.ForwardRefRenderFunction<
return wrapSSR(
props.href ? (
<a ref={ref as React.LegacyRef<HTMLAnchorElement>} {...restProps} className={classString}>
<a ref={ref as React.RefObject<HTMLAnchorElement>} {...restProps} className={classString}>
{buttonNode}
</a>
) : (
<button
ref={ref as React.LegacyRef<HTMLButtonElement>}
ref={ref as React.RefObject<HTMLButtonElement>}
{...restProps}
className={classString}
type="button"