diff --git a/react-sortable-mixin.js b/react-sortable-mixin.js index 47d1c36..c40c15f 100644 --- a/react-sortable-mixin.js +++ b/react-sortable-mixin.js @@ -134,6 +134,16 @@ this._sortableInstance = Sortable.create((this.refs[options.ref] || this).getDOMNode(), copyOptions); }, + componentWillReceiveProps: function (nextProps) { + var newState = {}, + modelName = _getModelName(this), + items; + + if (items = nextProps[modelName]) { + newState[modelName] = items; + this.setState(newState); + } + }, componentWillUnmount: function () { this._sortableInstance.destroy();