Skip to content

Commit ea8dd5c

Browse files
Merge pull request #121 from webdev-dev/master
Isotope Fix
2 parents abd2dfc + df1f2a1 commit ea8dd5c

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

lib/IsotopeGrid/IsotopeGrid.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,11 @@ var IsotopeGrid = function (_React$Component) {
194194
}
195195

196196
if (reload !== this.state.reload) this.setState({ reload: reload });
197-
if (options) this.state.isotope.arrange(_extends({}, options));
197+
if (options && this.state.isotope) {
198+
this.state.isotope.arrange(_extends({}, options));
199+
} else if (options) {
200+
this.createIsotope();
201+
}
198202
}
199203
}, {
200204
key: 'shouldComponentUpdate',

src/IsotopeGrid/IsotopeGrid.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,11 @@ class IsotopeGrid extends React.Component {
146146
}
147147

148148
if (reload !== this.state.reload) this.setState({ reload });
149-
if (options) this.state.isotope.arrange({ ...options });
149+
if (options && this.state.isotope) {
150+
this.state.isotope.arrange({ ...options });
151+
} else if (options) {
152+
this.createIsotope();
153+
}
150154
}
151155

152156
shouldComponentUpdate(nextProps, nextState) {

0 commit comments

Comments
 (0)