diff --git a/packages/taro-components-react/src/components/button/index.tsx b/packages/taro-components-react/src/components/button/index.tsx index 2d07c7d0da30..e96b3388b57a 100644 --- a/packages/taro-components-react/src/components/button/index.tsx +++ b/packages/taro-components-react/src/components/button/index.tsx @@ -3,7 +3,7 @@ import './style/index.scss' import classNames from 'classnames' import React from 'react' -import { omit } from '../../utils' +import { createForwardRefComponent, omit } from '../../utils' interface IProps extends Omit, 'type'> { size?: string @@ -15,6 +15,7 @@ interface IProps extends Omit, 'ty loading?: boolean type?: string className?: string + forwardedRef?: React.MutableRefObject } interface IState { @@ -54,6 +55,7 @@ class Button extends React.Component { hoverStayTime = 70, loading = false, type, + forwardedRef, } = this.props const cls = classNames( className, @@ -96,8 +98,9 @@ class Button extends React.Component { return (