Skip to content

Commit cd41fca

Browse files
committed
Add more details about applying classNames
1 parent a4df10f commit cd41fca

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

src/CSSTransition.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,23 @@ CSSTransition.propTypes = {
238238
* - `fade-enter`, `fade-enter-active`, `fade-enter-done`
239239
* - `fade-exit`, `fade-exit-active`, `fade-exit-done`
240240
*
241-
* **Note**: `fade-appear-done` and `fade-enter-done` will _both_ be applied.
242-
* This allows you to define different behavior for when appearing is done and
243-
* when regular entering is done, using selectors like
244-
* `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply an
245-
* epic entrance animation when element first appears in the DOM using
246-
* [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can
247-
* simply use `fade-enter-done` for defining both cases.
241+
* A few details to note about how these classes are applied:
242+
*
243+
* 1. They are _joined_ with the ones that are already defined on the child
244+
* component, so if you want to add some base styles, you can use
245+
* `className` without worrying that it will be overridden.
246+
*
247+
* 2. If the transition component mounts with `in={false}`, no classes are
248+
* applied yet. You might be expecting `*-exit-done`, but if you think
249+
* about it, a component cannot finish exiting if it hasn't entered yet.
250+
*
251+
* 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This
252+
* allows you to define different behavior for when appearing is done and
253+
* when regular entering is done, using selectors like
254+
* `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply
255+
* an epic entrance animation when element first appears in the DOM using
256+
* [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can
257+
* simply use `fade-enter-done` for defining both cases.
248258
*
249259
* Each individual classNames can also be specified independently like:
250260
*

0 commit comments

Comments
 (0)