Skip to content

Commit

Permalink
adding testID prop
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanwire committed Jan 7, 2022
1 parent 418442b commit ed1ace4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/SkeletonPlaceholder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ interface SkeletonPlaceholderProps {
* @default right
*/
direction?: "left" | "right";
testID?: string;
}

export default function SkeletonPlaceholder({
Expand All @@ -46,6 +47,7 @@ export default function SkeletonPlaceholder({
speed = 800,
highlightColor = "#F2F8FC",
direction = "right",
testID,
}: SkeletonPlaceholderProps): JSX.Element {
const [layout, setLayout] = React.useState<LayoutRectangle>();
const animatedValue = React.useMemo(() => new Animated.Value(0), []);
Expand Down Expand Up @@ -131,6 +133,7 @@ export default function SkeletonPlaceholder({
{getChildren(children)}
</View>
}
testID={testID}
>
<View style={{ flexGrow: 1, backgroundColor }} />
{speed > 0 && (
Expand Down Expand Up @@ -168,6 +171,7 @@ export default function SkeletonPlaceholder({
onLayout={(event) => {
setLayout(event.nativeEvent.layout);
}}
testID={testID}
>
{getChildren(children)}
</View>
Expand Down

0 comments on commit ed1ace4

Please sign in to comment.