Skip to content

Commit 3f22293

Browse files
authored
Merge pull request alexZajac#18 from ValentinH/patch-1
Restart animation on component update
2 parents a134736 + 6833153 commit 3f22293

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: src/SkeletonContent.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ export default class SkeletonContent extends React.Component<ISkeletonContentPro
122122
this.playAnimation();
123123
}
124124

125+
componentDidUpdate() {
126+
if(this.props.isLoading) {
127+
this.playAnimation();
128+
}
129+
}
130+
125131
playAnimation = () => {
126132
if (this.props.animationType === "pulse") {
127133
Animated.loop(

0 commit comments

Comments
 (0)