1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-08 23:25:51 +01:00

refactor: handles async for set state

This commit is contained in:
ayusharma 2018-07-03 09:49:35 +02:00
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});
}