Skip to content
This repository was archived by the owner on Nov 27, 2022. It is now read-only.

Commit cf44834

Browse files
committed
fix: tweak spring config for animation
This is configuration used by stack navigator. Feels very similar to what reddit app has.
1 parent 346f22d commit cf44834

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Pager.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,22 @@ const SWIPE_DISTANCE_MINIMUM = 20;
8383
const SWIPE_DISTANCE_MULTIPLIER = 1 / 1.75;
8484

8585
const SPRING_CONFIG = {
86-
damping: 30,
87-
mass: 1,
88-
stiffness: 200,
86+
stiffness: 1000,
87+
damping: 500,
88+
mass: 3,
8989
overshootClamping: true,
90-
restSpeedThreshold: 0.001,
91-
restDisplacementThreshold: 0.001,
90+
restDisplacementThreshold: 0.01,
91+
restSpeedThreshold: 0.01,
9292
};
9393

9494
const TIMING_CONFIG = {
95-
duration: 250,
95+
duration: 200,
9696
easing: Easing.out(Easing.cubic),
9797
};
9898

9999
export default class Pager<T: Route> extends React.Component<Props<T>> {
100100
static defaultProps = {
101-
swipeVelocityThreshold: 1200,
101+
swipeVelocityThreshold: 800,
102102
};
103103

104104
componentDidUpdate(prevProps: Props<T>) {

0 commit comments

Comments
 (0)