Skip to content

Commit 6833153

Browse files
authored
Restart animation on component update
1 parent eec1c99 commit 6833153

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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)