facebook/react — pull request #1941 by divad12 (2014-07-27 07:52:47+00:00)
Title: Clarify animating one or zero items in animation docs

When I first read these docs, it was not immediately clear to me that I could use `React.addons.CSSTransitionGroup` to animate a single item coming into view, or an item replacing an item already there. This was partly due to the example which rendered a list of items.

This PR adds a blurb about being able to use `React.addons.CSSTransitionGroup` with one or zero items, provides a code example, and adds a note blockquote that a `key` attribute must always be provided on each child of `React.addons.CSSTransitionGroup`. The latter point was not immediately obvious from the original `TodoList` code example, since it renders a list which would normally require `key` attributes anyway.

Renders as follow:

![image](https://cloud.githubusercontent.com/assets/159687/3713319/704b6afa-1561-11e4-9d4f-f5a73b879bbe.png)

Thanks @spicyj for helping me get this when I asked him a question and he answered, "why doesn't CSSTransitionGroup just do this for you?" And then I realized it totally does. :)

I have already signed the CLA.

Test Plan:
- Refreshed `http://localhost:4000/react/docs/animation.html`, saw that the docs additions rendered correctly (screenshot above).
- Example code not tested (it was extracted from working code).