Skip to content

DoubleBounce animation lag#30

Description

@denis-kungurov

Hi! 馃憢

Firstly, thanks for your work on this project! 馃檪

Today I used patch-package to patch react-native-loader@1.3.1 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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