mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-20 11:52:46 +00:00
Refactor ErrorNavItem to not need "this" parameter
Toward making edit/new/home pages functional, which do not have "this"
This commit is contained in:
@@ -80,11 +80,19 @@ const HomePage = createClass({
|
||||
brew : { ...prevState.brew, text: text },
|
||||
}));
|
||||
},
|
||||
|
||||
clearError : function(){
|
||||
setState({
|
||||
error : null,
|
||||
isSaving : false
|
||||
})
|
||||
},
|
||||
|
||||
renderNavbar : function(){
|
||||
return <Navbar ver={this.props.ver}>
|
||||
<Nav.section>
|
||||
{this.state.error ?
|
||||
<ErrorNavItem error={this.state.error} parent={this}></ErrorNavItem> :
|
||||
<ErrorNavItem error={this.state.error} clearError={clearError}></ErrorNavItem> :
|
||||
null
|
||||
}
|
||||
<NewBrewItem />
|
||||
|
||||
Reference in New Issue
Block a user