Skip to content

Commit 6ed5187

Browse files
committed
Revert "fix(children): Regenerate layout on children changed via shallowEqual"
This reverts commit d967edd. See react-grid-layout#304
1 parent d967edd commit 6ed5187

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/ReactGridLayout.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import isEqual from 'lodash.isequal';
44
import {autoBindHandlers, bottom, cloneLayoutItem, compact, getLayoutItem, moveElement,
55
synchronizeLayoutWithChildren, validateLayout} from './utils';
66
import GridItem from './GridItem';
7-
import shallowCompare from 'react-addons-shallow-compare';
87
const noop = function() {};
98

109
// Types
@@ -177,7 +176,7 @@ export default class ReactGridLayout extends React.Component {
177176
// If children change, also regenerate the layout. Use our state
178177
// as the base in case because it may be more up to date than
179178
// what is in props.
180-
else if (!shallowCompare(this.props.children, nextProps.children)) {
179+
else if (nextProps.children.length !== this.props.children.length) {
181180
newLayoutBase = this.state.layout;
182181
}
183182

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"homepage": "https://github.com/STRML/react-grid-layout",
3535
"dependencies": {
3636
"lodash.isequal": "^4.0.0",
37-
"react-addons-shallow-compare": "^15.3.0",
3837
"react-draggable": "^2.1.1",
3938
"react-resizable": "^1.4.0"
4039
},
@@ -81,4 +80,4 @@
8180
"pre-commit": [
8281
"lint"
8382
]
84-
}
83+
}

0 commit comments

Comments
 (0)