We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eac37c6 commit f7e837aCopy full SHA for f7e837a
src/components/Header.js
@@ -5,6 +5,10 @@ import { getToken, deleteToken } from '../utils';
5
6
const Header = ({ history }) => {
7
const authToken = getToken();
8
+ const logout = React.useCallback(() => {
9
+ deleteToken();
10
+ history.push('/');
11
+ }, [history])
12
return (
13
<div className="flex pa1 justify-between nowrap orange">
14
<div className="flex flex-fixed black">
@@ -33,10 +37,7 @@ const Header = ({ history }) => {
33
37
{authToken ? (
34
38
<div
35
39
className="ml1 pointer black"
36
- onClick={() => {
- deleteToken();
- history.push('/');
- }}
40
+ onClick={logout}
41
>
42
logout
43
</div>
0 commit comments