mirror of
https://github.com/stolksdorf/homebrewery.git
synced 2025-12-16 04:05:57 +00:00
HomebrewAdmin: Remove direct React state mutation.
This commit is contained in:
@@ -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