@@ -23,6 +23,8 @@ export interface CSSTransitionAttributes {
23
23
activeStyle ?: React . CSSProperties ;
24
24
enterStyle ?: React . CSSProperties ;
25
25
leaveStyle ?: React . CSSProperties ;
26
+ // TODO: test style attr.
27
+ style ?: React . CSSProperties ;
26
28
// TODO:
27
29
// prepareForTransition?: boolean;
28
30
// enterInitStyle?: React.CSSProperties;
@@ -51,6 +53,7 @@ function getRest(props: CSSTransitionProps): any {
51
53
delete rest . activeStyle ;
52
54
delete rest . enterStyle ;
53
55
delete rest . leaveStyle ;
56
+ delete rest . style ;
54
57
delete rest . vendorPrefixer ;
55
58
return rest ;
56
59
}
@@ -62,6 +65,7 @@ export class CSSTransition extends React.Component<CSSTransitionProps, CSSTransi
62
65
activeStyle : undefined ,
63
66
enterStyle : undefined ,
64
67
leaveStyle : undefined ,
68
+ style : { } ,
65
69
} ;
66
70
67
71
private appearTimer : NodeJS . Timer ;
@@ -203,35 +207,35 @@ enum Action {
203
207
204
208
const activeState = ( props : CSSTransitionProps ) => ( {
205
209
id : State . Active ,
206
- style : props . activeStyle ,
210
+ style : objectAssign ( { } , props . style , props . activeStyle ) ,
207
211
} ) ;
208
212
209
213
const defaultState = ( props : CSSTransitionProps ) => ( {
210
214
id : State . Default ,
211
- style : props . defaultStyle ,
215
+ style : objectAssign ( { } , props . style , props . defaultStyle ) ,
212
216
} ) ;
213
217
214
218
const transitToActiveAppearingState = ( props : CSSTransitionProps ) => ( {
215
219
id : State . TransitToActiveAppearing ,
216
- style : props . defaultStyle ,
220
+ style : objectAssign ( { } , props . style , props . defaultStyle ) ,
217
221
} ) ;
218
222
219
223
const transitToActiveRunningState = ( props : CSSTransitionProps ) => ( {
220
224
id : State . TransitToActiveRunning ,
221
- style : props . enterStyle ,
225
+ style : objectAssign ( { } , props . style , props . enterStyle ) ,
222
226
} ) ;
223
227
224
228
const transitToActiveStartedState = ( props : CSSTransitionProps ) => ( {
225
229
id : State . TransitToActiveStarted ,
226
- style : props . enterStyle ,
230
+ style : objectAssign ( { } , props . style , props . enterStyle ) ,
227
231
} ) ;
228
232
229
233
const transitToDefaultRunningState = ( props : CSSTransitionProps ) => ( {
230
234
id : State . TransitToDefaultRunning ,
231
- style : props . leaveStyle ,
235
+ style : objectAssign ( { } , props . style , props . leaveStyle ) ,
232
236
} ) ;
233
237
234
238
const transitToDefaultStartedState = ( props : CSSTransitionProps ) => ( {
235
239
id : State . TransitToDefaultStarted ,
236
- style : props . leaveStyle ,
240
+ style : objectAssign ( { } , props . style , props . leaveStyle ) ,
237
241
} ) ;
0 commit comments