@@ -45,14 +45,16 @@ export default class ReactCSSTransitionReplace extends React.Component {
45
45
transitionName : React . PropTypes . oneOfType ( [ React . PropTypes . string , React . PropTypes . shape ( {
46
46
enter : React . PropTypes . string ,
47
47
leave : React . PropTypes . string ,
48
- active : React . PropTypes . string
48
+ active : React . PropTypes . string ,
49
+ height : React . PropTypes . string
49
50
} ) , React . PropTypes . shape ( {
50
51
enter : React . PropTypes . string ,
51
52
enterActive : React . PropTypes . string ,
52
53
leave : React . PropTypes . string ,
53
54
leaveActive : React . PropTypes . string ,
54
55
appear : React . PropTypes . string ,
55
- appearActive : React . PropTypes . string
56
+ appearActive : React . PropTypes . string ,
57
+ height : React . PropTypes . string
56
58
} ) ] ) . isRequired ,
57
59
58
60
transitionAppear : React . PropTypes . bool ,
@@ -201,11 +203,18 @@ export default class ReactCSSTransitionReplace extends React.Component {
201
203
}
202
204
203
205
_wrapChild ( child , moreProps ) {
206
+ let transitionName = this . props . transitionName ;
207
+
208
+ if ( typeof transitionName === 'object' && transitionName !== null ) {
209
+ transitionName = { ...transitionName } ;
210
+ delete transitionName . height ;
211
+ }
212
+
204
213
// We need to provide this childFactory so that
205
214
// ReactCSSTransitionReplaceChild can receive updates to name,
206
215
// enter, and leave while it is leaving.
207
216
return reactCSSTransitionGroupChild ( {
208
- name : this . props . transitionName ,
217
+ name : transitionName ,
209
218
appear : this . props . transitionAppear ,
210
219
enter : this . props . transitionEnter ,
211
220
leave : this . props . transitionLeave ,
@@ -231,8 +240,13 @@ export default class ReactCSSTransitionReplace extends React.Component {
231
240
} ) ) ;
232
241
}
233
242
243
+
234
244
if ( height !== null ) {
235
- containerProps . className = `${ containerProps . className || '' } ${ transitionName } -height` ;
245
+ const heightClassName = ( typeof transitionName === 'object' && transitionName !== null ) ?
246
+ transitionName . height || '' :
247
+ `${ transitionName } -height` ;
248
+
249
+ containerProps . className = `${ containerProps . className || '' } ${ heightClassName } ` ;
236
250
containerProps . style = {
237
251
...containerProps . style ,
238
252
position : 'relative' ,
0 commit comments