From 512411b883a8993cbe2ca9676e24a2fc0b2e4506 Mon Sep 17 00:00:00 2001 From: Mikhail Vasin Date: Mon, 13 Aug 2018 22:44:46 +0300 Subject: [PATCH] Add transition status param to addEndListener if (node) clause is removed because it's not necessary a single concrete node --- src/Transition.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/Transition.js b/src/Transition.js index b7669646..5464bdff 100644 --- a/src/Transition.js +++ b/src/Transition.js @@ -260,7 +260,7 @@ class Transition extends React.Component { this.safeSetState({ status: ENTERED }, () => { this.props.onEntered(node, appearing) }) - }) + }, ENTERING) }) } @@ -284,7 +284,7 @@ class Transition extends React.Component { this.safeSetState({ status: EXITED }, () => { this.props.onExited(node) }) - }) + }, EXITING) }) } @@ -322,18 +322,14 @@ class Transition extends React.Component { return this.nextCallback } - onTransitionEnd(node, timeout, handler) { + onTransitionEnd(node, timeout, handler, status) { this.setNextCallback(handler) - if (node) { - if (this.props.addEndListener) { - this.props.addEndListener(node, this.nextCallback) - } - if (timeout != null) { - setTimeout(this.nextCallback, timeout) - } - } else { - setTimeout(this.nextCallback, 0) + if (this.props.addEndListener) { + this.props.addEndListener(node, this.nextCallback, status) + } + if (timeout != null) { + setTimeout(this.nextCallback, timeout) } }