question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OvershootClamping does not work since v1.5.0

See original GitHub issue

Hey everyone. Thanks for a great library.

I’m trying to implement an animation that runs a spring with overshootClamping. The code was working fine until I upgraded Reanimated to the newest version. Below is the code in question:

function runSpring(
  clock: Animated.Clock,
  animationState: Animated.PhysicsAnimationState,
): Animated.Node<number> {
  const config = {
    ...SpringUtils.makeDefaultConfig(),
    overshootClamping: true,
  };

  return block([
    cond(not(clockRunning(clock)), [
      set(animationState.finished, 0),
      startClock(clock),
    ]),
    spring(clock, animationState, config),
    cond(animationState.finished, stopClock(clock)),
    animationState.position,
  ]);
}

There seems to have been some regression in v1.5.0, because the code above no longer works properly. The animation does not apply the overshootClamping: true to the configuration.

Hopefully this can be fixed in future versions, as this issue prevents me from upgrading past version 1.4.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
jakub-gonetcommented, Apr 7, 2020

I managed to reproduce it on a snappable example in REA Example app.

After bisecting, it seems #468 (2dc3df7) introduced this regression.

@felixakiragreen, @Sakarisson

A possible workaround is to change export default (...) at the end of src/animation/spring.js to export default spring;

1reaction
jakub-gonetcommented, May 14, 2020

You can use patch-package library to do it, here’s a quick blog post about it

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Animated] Spring doesn't respect overshootClamping as a ...
[Animated] Spring doesn't respect overshootClamping as a hard stop. mkonicek. Moved from https://github.com/facebook/react-native/issues/2409.
Read more >
github.com-kmagiera-react-native-reanimated_ ... - Internet Archive
The problem there was that even though using Animated.event we could map gesture state to the position of the box and make this...
Read more >
Free Automated Malware Analysis Service - powered by Falcon ...
Submit malware for free analysis with Falcon Sandbox and Hybrid Analysis technology. Hybrid Analysis develops and licenses analysis tools to fight malware.
Read more >
HV7322 8-Channel 7-Level ±80V High Voltage Pulser with T/R ...
The HV7322 device is an 8-channel, true 5-level or ... Each of the pulsers has output voltage overshoot clamping diodes to the highest...
Read more >
Power Management & Supply
If the flyback current (ILPK and ISEC) does not reach zero before the next ... ICE2AXXX, as a function of the supply voltage...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found