refactor: handles async for set state
This commit is contained in:
parent
98abac4dec
commit
44eed627df
|
@ -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});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue