From a4afdefb9a2a5763cc5dc7aec5fd82426361753a Mon Sep 17 00:00:00 2001 From: Jaakko Ojalehto Date: Tue, 2 Mar 2021 11:29:35 +0200 Subject: [PATCH] Pass restProps to view --- index.d.ts | 5 ++--- lib/ShimmerPlaceholder.js | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/index.d.ts b/index.d.ts index 1030a22..78a8d62 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,9 +1,9 @@ declare module 'react-native-shimmer-placeholder' { import * as React from 'react'; - import { Animated } from 'react-native'; + import { Animated, ViewProps } from 'react-native'; - export interface ShimmerPlaceholderProps { + export interface ShimmerPlaceholderProps extends ViewProps { width?: number | string; height?: number | string; shimmerWidthPercent?: number; @@ -19,7 +19,6 @@ declare module 'react-native-shimmer-placeholder' { contentStyle?: any; isInteraction?: boolean; LinearGradient?: React.ComponentClass; - testID?: string; } class ShimmerPlaceholder extends React.Component { diff --git a/lib/ShimmerPlaceholder.js b/lib/ShimmerPlaceholder.js index 68d94de..1512950 100644 --- a/lib/ShimmerPlaceholder.js +++ b/lib/ShimmerPlaceholder.js @@ -54,7 +54,7 @@ const BasedShimmerPlaceholder = (props) => { animatedValue, beginShimmerPosition, shimmerWidthPercent = 1, - testID + ...restProps } = props const linearTranslate = beginShimmerPosition.interpolate({ @@ -83,7 +83,7 @@ const BasedShimmerPlaceholder = (props) => { return ( {/* Force render children to restrict rendering twice */} {children}