(Go: >> BACK << -|- >> HOME <<)

Skip to content

Commit

Permalink
type: ref type optimization (#43703)
Browse files Browse the repository at this point in the history
Co-authored-by: 我们去月球漫步 <13105694+flymetothemoon-wj@user.noreply.gitee.com>
  • Loading branch information
Negentropy247 and 我们去月球漫步 committed Jul 21, 2023
1 parent c831145 commit ab8e10d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 1 addition & 7 deletions components/button/LoadingIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions components/float-button/FloatButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit ab8e10d

Please sign in to comment.