mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
@@ -17,7 +17,7 @@ React provides a `ReactTransitionGroup` addon component as a low-level API for a
|
||||
|
||||
`ReactCSSTransitionGroup` is the interface to `ReactTransitions`. This is a simple element that wraps all of the components you are interested in animating. Here's an example where we fade list items in and out.
|
||||
|
||||
```javascript{22-24}
|
||||
```javascript{30-32}
|
||||
/** @jsx React.DOM */
|
||||
|
||||
var ReactCSSTransitionGroup = React.addons.CSSTransitionGroup;
|
||||
@@ -33,7 +33,7 @@ var TodoList = React.createClass({
|
||||
},
|
||||
handleRemove: function(i) {
|
||||
var newItems = this.state.items;
|
||||
newItems.splice(i, 1)
|
||||
newItems.splice(i, 1);
|
||||
this.setState({items: newItems});
|
||||
},
|
||||
render: function() {
|
||||
@@ -46,7 +46,7 @@ var TodoList = React.createClass({
|
||||
}.bind(this));
|
||||
return (
|
||||
<div>
|
||||
<div><button onClick={this.handleAdd} /></div>
|
||||
<button onClick={this.handleAdd}>Add Item</button>
|
||||
<ReactCSSTransitionGroup transitionName="example">
|
||||
{items}
|
||||
</ReactCSSTransitionGroup>
|
||||
|
||||
Reference in New Issue
Block a user