Skip to content

Commit b81463f

Browse files
HgAlexxwuweiweiwu
authored andcommitted
* Fix issue frontend-collective#369 * Better naming, use of const Co-Authored-By: HgAlexx <alex@mzhg.space> * Better naming Co-Authored-By: HgAlexx <alex@mzhg.space>
1 parent b5fde6d commit b81463f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/react-sortable-tree.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,12 @@ class ReactSortableTree extends Component {
155155
const { instanceProps } = prevState;
156156
const newState = {};
157157

158+
const isTreeDataEqual = isEqual(instanceProps.treeData, nextProps.treeData);
159+
158160
// make sure we have the most recent version of treeData
159161
instanceProps.treeData = nextProps.treeData;
160162

161-
if (!isEqual(instanceProps.treeData, nextProps.treeData)) {
163+
if (!isTreeDataEqual) {
162164
if (instanceProps.ignoreOneTreeUpdate) {
163165
instanceProps.ignoreOneTreeUpdate = false;
164166
} else {

0 commit comments

Comments
 (0)