Skip to content

Commit

Permalink
feat: Reset behaviour of animations to ensure consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
marcuzgabriel-topdk committed Oct 28, 2023
1 parent 6cb571a commit 02b1902
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"author": "Marcuz Gabriel Larsen <marcuzgabriel@gmail.com>",
"license": "MIT",
"name": "react-native-reanimated-skeleton",
"version": "1.3.2",
"version": "1.4.0",
"peerDependencies": {
"react": "*",
"react-native": "*",
Expand Down
3 changes: 3 additions & 0 deletions packages/npm/src/Skeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ const Skeleton: React.FC<ISkeletonProps> = ({
() => ({ isLoading, loadingValue }),
() => {
if (isLoading && loadingValue.value !== 1) {
/* NOTE: Reset behaviour to ensure animation always starts from the beginning */
animationValue.value = 0;

animationValue.value =
shiverValue.value === 1
? withRepeat(withTiming(1, { duration, easing }), -1, false)
Expand Down

0 comments on commit 02b1902

Please sign in to comment.