Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Animated] animated.timing start() callback not working #17875

Closed
nthgol opened this issue Feb 6, 2018 · 4 comments
Closed

[Animated] animated.timing start() callback not working #17875

nthgol opened this issue Feb 6, 2018 · 4 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@nthgol
Copy link

nthgol commented Feb 6, 2018

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Expo project

Environment:
OS: Windows 10
Node: 6.12.3
Yarn: 1.3.2
npm: 3.10.10
Watchman: Not Found
Xcode: N/A
Android Studio: Version 2.3.0.0 AI-162.4069837

Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: https://github.com/expo/react-native/archive/sdk-25.0.0.tar.gz => 0.52.0

Target Platform: iOS (11)

Steps to Reproduce

(Write your steps here:)

  1. Swipe the top card either to the left or right appreciably
  2. Past a certain swipe distance, the card will fly off the page.
  3. This should invoke .start(() => this.onSwipeComplete(direction)), however, it does not. Passing in a regular function call works, but the function is called immediately, not on finishing of animation.timing.
    [e.g. .start( this.onSwipeComplete(direction)) ]

Expected Behavior

I expect a callback to be invoked in Animation.timing().start()

Actual Behavior

Nothing is invoked. I can also try console logging as a callback , and that does not work

Reproducible Demo

https://github.com/nthgol/swipe
Expo app

(Paste the link to an example project and exact instructions to reproduce the issue.)

@nthgol nthgol closed this as completed Feb 6, 2018
@nthgol
Copy link
Author

nthgol commented Feb 6, 2018

Closed - feel free to remove. My animation was never finishing apparently.

@mszymulanski
Copy link

Can you share how you solved the issue?

@nthgol
Copy link
Author

nthgol commented May 25, 2018

just ensure the animation you have defined actually ends. mine was looping infinitely

@mszymulanski
Copy link

My problem was that I was using input from TextInput for the toValue option in the Animated.timing(.., {toValue: myInput}) without parsing myInput to an Int. I hope it will help anyone with the same issue.

@facebook facebook locked as resolved and limited conversation to collaborators Feb 6, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Feb 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants