import React, {Component, PropTypes} from 'react';
import {findDOMNode} from 'react-dom';
import invariant from 'invariant';

// Export Higher Order Sortable Element Component
export default function SortableElement (WrappedComponent, config = {withRef: false}) {
    return class extends Component {
        static displayName = (WrappedComponent.displayName) ? `SortableElement(${WrappedComponent.displayName})` : 'SortableElement';
        static WrappedComponent = WrappedComponent;
        static contextTypes = {
            manager: PropTypes.object.isRequired
        };
        static propTypes = {
            index: PropTypes.number.isRequired,
            collection: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
            disabled: PropTypes.bool
        };
        static defaultProps = {
            collection: 0
        };
        componentDidMount() {
            let {collection, disabled, index} = this.props;

            if (!disabled) {
                let node = this.node = findDOMNode(this);

                node.sortableInfo = {index, collection};

                this.ref = {node};
                this.context.manager.add(collection, this.ref);
            }
        }
        componentWillReceiveProps(nextProps) {
            const {index} = this.props;
            if (index !== nextProps.index && this.node) {
                this.node.sortableInfo.index = nextProps.index;
            }
        }
        componentWillUnmount() {
            let {collection, disabled} = this.props;

            if (!disabled) this.context.manager.remove(collection, this.ref);
        }
        getWrappedInstance() {
            invariant(config.withRef, 'To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call');
            return this.refs.wrappedInstance;
        }
        render() {
            const ref = (config.withRef) ? 'wrappedInstance' : null;
            return (
                <WrappedComponent ref={ref} {...this.props} />
            );
        }
    }
}

@@ -871,32 +871,33 @@
 entDidMount() %7B%0A
+%0A
             let 
@@ -990,205 +990,43 @@
     
-let node = this.node = findDOMNode(this);%0A%0A                node.sortableInfo = %7Bindex, collection%7D;%0A%0A                this.ref = %7Bnode%7D;%0A                this.context.manager.add(collection, this.ref
+this.setDraggable(collection, index
 );%0A 
@@ -1263,32 +1263,386 @@
 ;%0A            %7D%0A
+            if (this.props.disabled !== nextProps.disabled)%0A            %7B%0A                let %7Bcollection, disabled, index%7D = nextProps;%0A                if (disabled) %7B%0A                    this.removeDraggable(collection);%0A                %7D%0A                else %7B%0A                    this.setDraggable(collection, index);%0A                %7D%0A            %7D%0A
         %7D%0A      
@@ -1627,32 +1627,33 @@
     %7D%0A        %7D%0A
+%0A
         componen
@@ -1749,16 +1749,372 @@
 isabled)
+ this.removeDraggable(collection);%0A        %7D%0A%0A        %0A        setDraggable(collection, index)%7B%0A            let node = this.node = findDOMNode(this);%0A%0A            node.sortableInfo = %7Bindex, collection%7D;%0A%0A            this.ref = %7Bnode%7D;%0A            this.context.manager.add(collection, this.ref);%0A        %7D%0A%0A        removeDraggable(collection) %7B%0A           
  this.co
@@ -2159,32 +2159,33 @@
 ref);%0A        %7D%0A
+%0A
         getWrapp

Fix changing disable property while receiving props