mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
Update Animation docs for createElement
This commit is contained in:
@@ -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>
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user