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';
117117
118118class 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: 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+ }
129138 handleStart (evt ) { // Dragging started
130139 }
131140 handleEnd (evt ) { // Dragging ended
You can’t perform that action at this time.
0 commit comments