File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -280,15 +280,16 @@ class ReactSortableTree extends Component {
280280 static getDerivedStateFromProps ( nextProps , prevState ) {
281281 const { instanceProps } = prevState
282282 const newState = { }
283+ const newInstanceProps = { ...instanceProps }
283284
284285 const isTreeDataEqual = isEqual ( instanceProps . treeData , nextProps . treeData )
285286
286287 // make sure we have the most recent version of treeData
287- instanceProps . treeData = nextProps . treeData
288+ newInstanceProps . treeData = nextProps . treeData
288289
289290 if ( ! isTreeDataEqual ) {
290291 if ( instanceProps . ignoreOneTreeUpdate ) {
291- instanceProps . ignoreOneTreeUpdate = false
292+ newInstanceProps . ignoreOneTreeUpdate = false
292293 } else {
293294 newState . searchFocusTreeIndex = undefined
294295 ReactSortableTree . loadLazyChildren ( nextProps , prevState )
@@ -317,9 +318,9 @@ class ReactSortableTree extends Component {
317318 )
318319 }
319320
320- instanceProps . searchQuery = nextProps . searchQuery
321- instanceProps . searchFocusOffset = nextProps . searchFocusOffset
322- newState . instanceProps = { ...instanceProps , ...newState . instanceProps }
321+ newInstanceProps . searchQuery = nextProps . searchQuery
322+ newInstanceProps . searchFocusOffset = nextProps . searchFocusOffset
323+ newState . instanceProps = { ...newInstanceProps , ...newState . instanceProps }
323324
324325 return newState
325326 }
You can’t perform that action at this time.
0 commit comments