mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-27 02:52:43 +00:00
PrintPage: Fix potentially inconsistent React state update
This commit is contained in:
@@ -22,7 +22,9 @@ const PrintPage = createClass({
|
||||
|
||||
componentDidMount : function() {
|
||||
if(this.props.query.local){
|
||||
this.setState({ brewText: localStorage.getItem(this.props.query.local) });
|
||||
this.setState((prevState, prevProps) => ({
|
||||
brewText: localStorage.getItem(prevProps.query.local)
|
||||
}));
|
||||
}
|
||||
|
||||
if(this.props.query.dialog) window.print();
|
||||
|
||||
Reference in New Issue
Block a user