File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44A higher order React component for [ Sortable] ( https://github.com/RubaXa/Sortable ) .
55
6- Demo: http://cheton.github.io/react-sortable
6+ - Demo: http://cheton.github.io/react-sortable
7+ - Live Coding at WebpackBin: http://www.webpackbin.com/VJe8dfMpe
78
89The sample code can be found in the [ examples] ( https://github.com/cheton/react-sortable/tree/master/examples ) directory.
910
@@ -116,15 +117,24 @@ import Sortable from 'react-sortablejs';
116117
117118class MySortableList extends React .Component {
118119 static propTypes = {
120+ sortableInstance: React .PropTypes .object ,
119121 items: React .PropTypes .array
120122 };
121123 static defaultProps = {
124+ sortableInstance: null
122125 items: []
123126 };
124127 state = {
125128 items: this .props .items
126129 };
127130
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+ }
128138 handleStart (evt ) { // Dragging started
129139 }
130140 handleEnd (evt ) { // Dragging ended
You can’t perform that action at this time.
0 commit comments