From 38ab243f2d343c0d3a2ea9602e8bd7dc9a97645f Mon Sep 17 00:00:00 2001 From: Yair Levi Date: Thu, 7 Jun 2018 16:14:19 -0700 Subject: [PATCH] Make animation configuration a function --- src/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index 244bf99..8dc55a1 100644 --- a/src/index.js +++ b/src/index.js @@ -23,7 +23,7 @@ export default class Swipeable extends PureComponent { onLeftActionComplete: PropTypes.func, leftActionActivationDistance: PropTypes.number, leftActionReleaseAnimationFn: PropTypes.func, - leftActionReleaseAnimationConfig: PropTypes.object, + leftActionReleaseAnimationConfig: PropTypes.func, // right action lifecycle onRightActionActivate: PropTypes.func, @@ -32,7 +32,7 @@ export default class Swipeable extends PureComponent { onRightActionComplete: PropTypes.func, rightActionActivationDistance: PropTypes.number, rightActionReleaseAnimationFn: PropTypes.func, - rightActionReleaseAnimationConfig: PropTypes.object, + rightActionReleaseAnimationConfig: PropTypes.func, // left buttons lifecycle onLeftButtonsActivate: PropTypes.func, @@ -592,11 +592,11 @@ export default class Swipeable extends PureComponent { } = this.state; if (leftActionActivated && leftActionReleaseAnimationConfig) { - return leftActionReleaseAnimationConfig; + return leftActionReleaseAnimationConfig(); } if (rightActionActivated && rightActionReleaseAnimationConfig) { - return rightActionReleaseAnimationConfig; + return rightActionReleaseAnimationConfig(); } if (leftButtonsActivated) {