Drag/Drop sortable collections using React-DnD
npm install react-dnd-sortableReact Sortable
==============
> Provides a thin wrapper around React Dnd so you don't have to worry about the inner workings
> of that lib. Allows for live sorting with a callback on 'drop' with the newly sorted collection
#### Usage
( See example/app.jsx for another working example )
``javascript
var React = require('react'),
Sortable = require('react-sortable'),
classnames = require('classnames');
var Template = React.createClass({
propTypes: {
isOver: React.PropTypes.boolean // injected by ReactSortable
},
render: function () {
return (
Item {this.props.x} for {this.props.y}
// Get from some store
var collection = [
{x: 1, y: 2},
{x: 3, y: 4},
{x: 5, y: 6},
{x: 7, y: 8}
];
var SortableCollection = React.createClass({
getInitialState: function () {
return {
collection: collection
};
},
render: function () {
return (
template={} />
);
},
_handleSorted: function (sortedCollection) {
this.setState({collection: sortedCollection});
}
});
`
#### TODO
1. Right now sortable collection wraps items in a