From 6a984090fb360aacde2493fda73055326b637f03 Mon Sep 17 00:00:00 2001 From: oasis Date: Tue, 18 Feb 2025 16:37:24 +0800 Subject: [PATCH] fix: taro button cannot be compiled into an h5 tag --- src/packages/button/button.taro.tsx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/packages/button/button.taro.tsx b/src/packages/button/button.taro.tsx index 1eca6d9c61..15035aa34a 100644 --- a/src/packages/button/button.taro.tsx +++ b/src/packages/button/button.taro.tsx @@ -1,11 +1,7 @@ -import React, { CSSProperties, useCallback, useMemo } from 'react' import type { MouseEvent } from 'react' +import React, { CSSProperties, useCallback, useMemo } from 'react' import classNames from 'classnames' -import { - ButtonProps as MiniProgramButtonProps, - View, - Button as TaroButton, -} from '@tarojs/components' +import { ButtonProps as MiniProgramButtonProps, View } from '@tarojs/components' import { Loading } from '@nutui/icons-react-taro' import { getEnv } from '@tarojs/taro' import { BasicComponent, ComponentDefaults } from '@/utils/typings' @@ -148,13 +144,14 @@ export const Button = React.forwardRef>( ;(rest as any).type = rest.formType } return ( - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore // eslint-disable-next-line react/button-has-type - handleClick(e as any)} @@ -174,7 +171,7 @@ export const Button = React.forwardRef>( )} {rightIcon} - + ) } )