diff --git a/packages/taro-components-rn/src/components/Image/index.tsx b/packages/taro-components-rn/src/components/Image/index.tsx index a7f62c3e6ca1..762657ba4773 100644 --- a/packages/taro-components-rn/src/components/Image/index.tsx +++ b/packages/taro-components-rn/src/components/Image/index.tsx @@ -22,7 +22,7 @@ import { LayoutChangeEvent, ImageResolvedAssetSource } from 'react-native' -import { noop } from '../../utils' +import { noop, omit } from '../../utils' // import ClickableSimplified from '../ClickableSimplified' import { ImageProps, ImageState, Mode, ResizeModeMap, ResizeMode } from './PropsType' @@ -157,6 +157,7 @@ class _Image extends React.Component { return flattenStyle.height || 225 } })() + const restImageProps = omit(this.props, ['source', 'resizeMode', 'onLoad', 'onError', 'onLayout', 'style']) return ( { height: imageHeight } ]} + {...restImageProps} /> ) }