Browse Source

Update Animation docs for createElement

main
Paul O’Shannessy 10 years ago
parent
commit
66aecc35a0
  1. 10
      docs/09.1-animation.md

10
docs/09.1-animation.md

@ -165,17 +165,21 @@ This is called when the `willLeave` `callback` is called (at the same time as `c
By default `ReactTransitionGroup` renders as a `span`. You can change this behavior by providing a `component` prop. For example, here's how you would render a `<ul>`:
```javascript{1}
<ReactTransitionGroup component={React.DOM.ul}>
<ReactTransitionGroup component="ul">
...
</ReactTransitionGroup>
```
Every DOM component is under `React.DOM`. However, `component` does not need to be a DOM component. It can be any React component you want; even ones you've written yourself!
Every DOM component that React can render is available for use. However, `component` does not need to be a DOM component. It can be any React component you want; even ones you've written yourself!
> Note:
>
> Prior to v0.12, when using DOM components, the `component` prop needed to be a reference to `React.DOM.*`. Since the component is simply passed to `React.createElement`, it must now be a string. Composite components must pass the factory.
Any additional, user-defined, properties will be become properties of the rendered component. For example, here's how you would you render a `<ul>` with css class:
```javascript{1}
<ReactTransitionGroup component={React.DOM.ul} className="animated-list">
<ReactTransitionGroup component="ul" className="animated-list">
...
</ReactTransitionGroup>
```

Loading…
Cancel
Save