Skip to content

Commit f8b0a29

Browse files
committed
Only add the isLeaving prop to children if notifyLeaving is true.
1 parent 64ae270 commit f8b0a29

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ReactCSSTransitionReplace.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@ export default class ReactCSSTransitionReplace extends React.Component {
3333
transitionEnterTimeout: transitionTimeout('Enter'),
3434
transitionLeaveTimeout: transitionTimeout('Leave'),
3535
overflowHidden: PropTypes.bool,
36+
notifyLeaving: PropTypes.bool,
3637
}
3738

3839
static defaultProps = {
3940
transitionAppear: false,
4041
transitionEnter: true,
4142
transitionLeave: true,
4243
overflowHidden: true,
44+
notifyLeaving: false,
4345
component: 'span',
4446
childComponent: 'span',
4547
}
@@ -210,7 +212,7 @@ export default class ReactCSSTransitionReplace extends React.Component {
210212
const childrenToRender = []
211213

212214
const {
213-
overflowHidden, transitionName, component, childComponent,
215+
overflowHidden, transitionName, component, childComponent, notifyLeaving,
214216
transitionAppear, transitionEnter, transitionLeave,
215217
transitionAppearTimeout, transitionEnterTimeout, transitionLeaveTimeout,
216218
...containerProps
@@ -254,7 +256,7 @@ export default class ReactCSSTransitionReplace extends React.Component {
254256
},
255257
},
256258
this.wrapChild(
257-
typeof child.type !== 'string'
259+
notifyLeaving && typeof child.type !== 'string'
258260
? React.cloneElement(child, {isLeaving: true})
259261
: child,
260262
{

0 commit comments

Comments
 (0)