File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -117,15 +117,24 @@ import Sortable from 'react-sortablejs';
117
117
118
118
class MySortableList extends React .Component {
119
119
static propTypes = {
120
+ sortableInstance: React .PropTypes .object ,
120
121
items: React .PropTypes .array
121
122
};
122
123
static defaultProps = {
124
+ sortableInstance: null
123
125
items: []
124
126
};
125
127
state = {
126
128
items: this .props .items
127
129
};
128
130
131
+ componentDidUpdate () {
132
+ // Note: sortableInstance object is null for the initial render
133
+ const { sortableInstance } = this .props ;
134
+
135
+ // See supported instance methods at https://github.com/RubaXa/Sortable#method
136
+ console .log (sortableInstance .toArray ());
137
+ }
129
138
handleStart (evt ) { // Dragging started
130
139
}
131
140
handleEnd (evt ) { // Dragging ended
You can’t perform that action at this time.
0 commit comments