[Error handling] 로그아웃 시 헤더에서 함수 순서 때문에 userInfo.nickname을 먼저 받아와서 userInfo.nickname is not defined 가 뜬 애러
Open
Complete
error
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
> > 해결된 에러라면 라벨에 'Complete' 를 달아주세요.
> > 미해결된 에러라면 라벨을 'In progress' 로 변경해주세요.
>
> ### 어떤 에러인가요?
> 헤더에서 만난 애러
>
> ### 에러 핸들링 방법
> * 로그아웃시에 로딩 페이지를 넣어 값이 변경 될 때 까지 시간을 번다음에 함수를 실행 시키면 됩니다
>
> ```js
const handleLogout = () => {
axios
.post('https://localhost:4000/logout',
{},
{ withCredentials: true })
.then(() => {
setReady(true)
setTimeout(()=>{
setReady(false)
},1000)
setUserinfo(null);
setIsLogin(false);
history.push('/');
});
};
> ```
>
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.