@@ -98,7 +98,11 @@ class CSSTransition extends React.Component {
98
98
}
99
99
100
100
onEntered = ( node , appearing ) => {
101
- const { doneClassName } = this . getClassNames ( 'enter' ) ;
101
+ const appearClassName = this . getClassNames ( 'appear' ) . doneClassName ;
102
+ const enterClassName = this . getClassNames ( 'enter' ) . doneClassName ;
103
+ const doneClassName = appearing
104
+ ? `${ appearClassName } ${ enterClassName } `
105
+ : enterClassName ;
102
106
103
107
this . removeClasses ( node , appearing ? 'appear' : 'enter' ) ;
104
108
addClass ( node , doneClassName ) ;
@@ -203,17 +207,29 @@ CSSTransition.propTypes = {
203
207
...Transition . propTypes ,
204
208
205
209
/**
206
- * The animation classNames applied to the component as it enters, exits or has finished the transition.
207
- * A single name can be provided and it will be suffixed for each stage: e.g.
210
+ * The animation classNames applied to the component as it enters, exits or
211
+ * has finished the transition. A single name can be provided and it will be
212
+ * suffixed for each stage: e.g.
213
+ *
214
+ * `classNames="fade"` applies `fade-enter`, `fade-enter-active`,
215
+ * `fade-enter-done`, `fade-exit`, `fade-exit-active`, `fade-exit-done`,
216
+ * `fade-appear`, `fade-appear-active`, and `fade-appear-done`.
217
+ *
218
+ * **Note**: `fade-appear-done` and `fade-enter-done` will _both_ be applied.
219
+ * This allows you to define different behavior for when appearing is done and
220
+ * when regular entering is done, using selectors like
221
+ * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply an
222
+ * epic entrance animation when element first appears in the DOM using
223
+ * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can
224
+ * simply use `fade-enter-done` for defining both cases.
208
225
*
209
- * `classNames="fade"` applies `fade-enter`, `fade-enter-active`, `fade-enter-done`,
210
- * `fade-exit`, `fade-exit-active`, `fade-exit-done`, `fade-appear`, and `fade-appear-active`.
211
226
* Each individual classNames can also be specified independently like:
212
227
*
213
228
* ```js
214
229
* classNames={{
215
230
* appear: 'my-appear',
216
231
* appearActive: 'my-active-appear',
232
+ * appearDone: 'my-done-appear',
217
233
* enter: 'my-enter',
218
234
* enterActive: 'my-active-enter',
219
235
* enterDone: 'my-done-enter',
@@ -229,8 +245,8 @@ CSSTransition.propTypes = {
229
245
* import styles from './styles.css';
230
246
* ```
231
247
*
232
- * you might want to use camelCase in your CSS file, that way could simply spread
233
- * them instead of listing them one by one:
248
+ * you might want to use camelCase in your CSS file, that way could simply
249
+ * spread them instead of listing them one by one:
234
250
*
235
251
* ```js
236
252
* classNames={{ ...styles }}
@@ -239,6 +255,7 @@ CSSTransition.propTypes = {
239
255
* @type {string | {
240
256
* appear?: string,
241
257
* appearActive?: string,
258
+ * appearDone?: string,
242
259
* enter?: string,
243
260
* enterActive?: string,
244
261
* enterDone?: string,
@@ -273,7 +290,6 @@ CSSTransition.propTypes = {
273
290
*/
274
291
onEntered : PropTypes . func ,
275
292
276
-
277
293
/**
278
294
* A `<Transition>` callback fired immediately after the 'exit' class is
279
295
* applied.
0 commit comments