Skip to content

DoubleBounce animation lag #30

@denis-kungurov

Description

@denis-kungurov

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

I have problem with DoubleBounce animation. It starts after 1 second after render and its looks weird.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-loader/src/DoubleBounce.js b/node_modules/react-native-loader/src/DoubleBounce.js
index 5cf93c1..4c324c4 100644
--- a/node_modules/react-native-loader/src/DoubleBounce.js
+++ b/node_modules/react-native-loader/src/DoubleBounce.js
@@ -25,7 +25,7 @@ export default class Pulse extends Component {
 
   componentDidMount() {
     this.animate(0);
-    setTimeout(() => this.animate(1), 1000);
+    this.animate(1);
   }
 
   componentWillUnmount() {
@@ -36,12 +36,12 @@ export default class Pulse extends Component {
     Animated
       .sequence([
         Animated.timing(this.state.bounces[index], {
-          toValue: 1,
+          toValue: index,
           duration: 1000,
           useNativeDriver: false
         }),
         Animated.timing(this.state.bounces[index], {
-          toValue: 0,
+          toValue: !index,
           duration: 1000,
           useNativeDriver: false
         })

This issue body was partially generated by patch-package.

Pull request for this issue: #29

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions