Skip to content

Commit

Permalink
Pass restProps to view
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeikko committed Mar 2, 2021
1 parent 1dd4041 commit a4afdef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions 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;
Expand All @@ -19,7 +19,6 @@ declare module 'react-native-shimmer-placeholder' {
contentStyle?: any;
isInteraction?: boolean;
LinearGradient?: React.ComponentClass<any>;
testID?: string;
}

class ShimmerPlaceholder extends React.Component<ShimmerPlaceholderProps, any> {
Expand Down
4 changes: 2 additions & 2 deletions lib/ShimmerPlaceholder.js
Expand Up @@ -54,7 +54,7 @@ const BasedShimmerPlaceholder = (props) => {
animatedValue,
beginShimmerPosition,
shimmerWidthPercent = 1,
testID
...restProps
} = props

const linearTranslate = beginShimmerPosition.interpolate({
Expand Down Expand Up @@ -83,7 +83,7 @@ const BasedShimmerPlaceholder = (props) => {
return (
<View
style={[!visible && { height, width }, styles.container, !visible && shimmerStyle, style]}
testID={testID}
{...restProps}
>
{/* Force render children to restrict rendering twice */}
<View style={[!visible && { width: 0, height: 0, opacity: 0 }, visible && contentStyle]}>{children}</View>
Expand Down

0 comments on commit a4afdef

Please sign in to comment.