From 7fcdf13f43e5f99563d5a99c95f58958b69f4136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Eschke?= Date: Sun, 21 Jul 2019 13:37:20 +0200 Subject: [PATCH] added transition status parameter to addEndListener prop so when using SwitchTransition with javascript animations for dynamic components (which don't have a `show` variable) the addEndListener prop can decide which animation to run based on the current status. `exiting` or `entering` is being passed down in the following example: ```jsx { if (status === "exiting") { // dont know why, but the return seems necessary return TweenMax.to(node, 2, { yPercent: 100, onComplete: done }) } if (status === "entering") return TweenMax.from(node, 2, { yPercent: 100, clearProps: "all", onComplete: done }) } } > setAnswer(currentQuestionId, value) } /> ``` --- src/Transition.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Transition.js b/src/Transition.js index 765ba9a5..4de2039c 100644 --- a/src/Transition.js +++ b/src/Transition.js @@ -319,7 +319,7 @@ class Transition extends React.Component { } if (this.props.addEndListener) { - this.props.addEndListener(node, this.nextCallback) + this.props.addEndListener(node, this.nextCallback, this.state.status) } if (timeout != null) {