Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Mar 19, 2016
2 parents e6ed41f + 6619a48 commit 98d4f4c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -117,15 +117,24 @@ import Sortable from 'react-sortablejs';

class MySortableList extends React.Component {
static propTypes = {
sortableInstance: React.PropTypes.object,
items: React.PropTypes.array
};
static defaultProps = {
sortableInstance: null
items: []
};
state = {
items: this.props.items
};

componentDidUpdate() {
// Note: The sortableInstance is null for the initial render
const { sortableInstance } = this.props;

// You can see all the methods at https://github.com/RubaXa/Sortable#method
console.log(sortableInstance.toArray());
}
handleStart(evt) { // Dragging started
}
handleEnd(evt) { // Dragging ended
Expand Down

0 comments on commit 98d4f4c

Please sign in to comment.