This repository was archived by the owner on Sep 19, 2024. It is now read-only.
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 {
280
280
static getDerivedStateFromProps ( nextProps , prevState ) {
281
281
const { instanceProps } = prevState
282
282
const newState = { }
283
+ const newInstanceProps = { ...instanceProps }
283
284
284
285
const isTreeDataEqual = isEqual ( instanceProps . treeData , nextProps . treeData )
285
286
286
287
// make sure we have the most recent version of treeData
287
- instanceProps . treeData = nextProps . treeData
288
+ newInstanceProps . treeData = nextProps . treeData
288
289
289
290
if ( ! isTreeDataEqual ) {
290
291
if ( instanceProps . ignoreOneTreeUpdate ) {
291
- instanceProps . ignoreOneTreeUpdate = false
292
+ newInstanceProps . ignoreOneTreeUpdate = false
292
293
} else {
293
294
newState . searchFocusTreeIndex = undefined
294
295
ReactSortableTree . loadLazyChildren ( nextProps , prevState )
@@ -317,9 +318,9 @@ class ReactSortableTree extends Component {
317
318
)
318
319
}
319
320
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 }
323
324
324
325
return newState
325
326
}
You can’t perform that action at this time.
0 commit comments