mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-22 10:06:58 +00:00
HomebrewAdmin: Remove direct React state mutation.
This commit is contained in:
1 parent
74f92f3e44
commit
ff0aa56ddc
1 file changed
+3
-2
@@ -38,9 +38,10 @@ const HomebrewAdmin = createClass({
|
||||
})
|
||||
.end((err, res)=>{
|
||||
if(err || !res.body || !res.body.brews) return;
|
||||
this.state.brewCache[page] = res.body.brews;
|
||||
const newCache = _.extend({}, this.state.brewCache);
|
||||
newCache[page] = res.body.brews;
|
||||
this.setState({
|
||||
brewCache : this.state.brewCache,
|
||||
brewCache : newCache,
|
||||
total : res.body.total,
|
||||
count : res.body.count
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user