Skip to content

Instantly share code, notes, and snippets.

@JoeTheDave
Created July 1, 2016 03:05
Show Gist options
  • Save JoeTheDave/3dee6bc7f9b0f075328b47f1d91b01aa to your computer and use it in GitHub Desktop.
Save JoeTheDave/3dee6bc7f9b0f075328b47f1d91b01aa to your computer and use it in GitHub Desktop.
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