refactor: handles async for set state

This commit is contained in:
ayusharma 2018-07-03 09:49:35 +02:00
parent 98abac4dec
commit 44eed627df
1 changed files with 3 additions and 3 deletions

View File

@ -31,9 +31,9 @@ export default class Header extends React.Component {
}
toggleLoginModal() {
this.setState({
showLogin: !this.state.showLogin
});
this.setState((prevState) => ({
showLogin: !prevState.showLogin
}));
this.setState({loginError: null});
}