Created
July 1, 2016 03:05
-
-
Save JoeTheDave/3dee6bc7f9b0f075328b47f1d91b01aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactCSSTransitionGroup from 'react-addons-css-transition-group'; | |
const Example = ({items, removeItemHandler}) => { | |
return ( | |
<div> | |
<ReactCSSTransitionGroup transitionName="example" transitionEnterTimeout={700} transitionLeaveTimeout={700}> | |
{items.map(function(item) { | |
return ( | |
<div key={item.id} className="todo-item" onClick={removeItemHandler.bind(null, item)}> | |
{item.name} | |
</div> | |
); | |
})} | |
</ReactCSSTransitionGroup> | |
</div> | |
); | |
}; | |
Example.propTypes = { | |
items: React.PropTypes.array.isRequired, | |
removeItemHandler: React.PropTypes.func.isRequired | |
}; | |
export default Example; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment