Skip to content

Commit

Permalink
fix: added view props
Browse files Browse the repository at this point in the history
  • Loading branch information
kyawthura-gg committed Feb 17, 2023
1 parent ce9c018 commit 840861c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/skeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const Skeleton = <T,>({
spacing = 10,
style,
height = 14,
...rest
}: SkeletonProps<T>) => {
const opacity = useRef(new Animated.Value(0.3)).current;

Expand Down Expand Up @@ -52,7 +53,9 @@ export const Skeleton = <T,>({
}, [opacity]);

if (!count || count === 1 || count === 0) {
return <Animated.View testID={'skeleton'} style={[appStyle, style]} />;
return (
<Animated.View testID={'skeleton'} style={[appStyle, style]} {...rest} />
);
}
return (
<>
Expand All @@ -65,6 +68,7 @@ export const Skeleton = <T,>({
appStyle,
style,
]}
{...rest}
/>
))}
</>
Expand Down
4 changes: 2 additions & 2 deletions src/skeleton.type.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { StyleProp, ViewStyle } from 'react-native';
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';

type DefaultTypes = {
type DefaultTypes = ViewProps & {
count?: number;
color?: string;
style?: StyleProp<ViewStyle>;
Expand Down

0 comments on commit 840861c

Please sign in to comment.