Skip to content

Commit 98d4f4c

Browse files
committed
Merge branch 'dev'
2 parents e6ed41f + 6619a48 commit 98d4f4c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,24 @@ import Sortable from 'react-sortablejs';
117117

118118
class MySortableList extends React.Component {
119119
static propTypes = {
120+
sortableInstance: React.PropTypes.object,
120121
items: React.PropTypes.array
121122
};
122123
static defaultProps = {
124+
sortableInstance: null
123125
items: []
124126
};
125127
state = {
126128
items: this.props.items
127129
};
128130

131+
componentDidUpdate() {
132+
// Note: The sortableInstance is null for the initial render
133+
const { sortableInstance } = this.props;
134+
135+
// You can see all the methods at https://github.com/RubaXa/Sortable#method
136+
console.log(sortableInstance.toArray());
137+
}
129138
handleStart(evt) { // Dragging started
130139
}
131140
handleEnd(evt) { // Dragging ended

0 commit comments

Comments
 (0)