Skip to content

Commit

Permalink
docs: document key prop trick in TransitionGroup (#467)
Browse files Browse the repository at this point in the history
* better docs for TransitionGroup about use of `key` prop on children

* tweaks from silvenon to merge
  • Loading branch information
shelldandy authored and silvenon committed Mar 14, 2019
1 parent 3a4cf9c commit c73de46
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/TransitionGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ TransitionGroup.propTypes = {
* leave. the `<TransitionGroup>` will inject specific transition props, so
* remember to spread them through if you are wrapping the `<Transition>` as
* with our `<Fade>` example.
*
* While this component is meant to make it easier to animate multiple
* `Transition` or `CSSTransition` children, sometimes you want to transition a
* single child by changing its content, e.g. routes, slides, images in a
* carousel etc. In that case you can change the `key` prop of the child
* component along with its content, that way `TransitionGroup` will know that
* it should transition the child.
*/
children: PropTypes.node,

Expand Down

0 comments on commit c73de46

Please sign in to comment.