codestates / codestates/SoundBubble
[Dev_Log] 8/18 (수) 정제윤
- Dominant language
- TypeScript
- Stars
- 3
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
### 오늘은 어떻게 프로젝트에 기여했나요?
- 버블 상세페이지 댓글 CRUD
- 마이페이지 - 나의팔레트 서버와 연결
### 오늘의 프로젝트에서 배운 점은 무엇인가요?
* react-router-dom의 useHistory를 사용해 페이지를 변경해주려고 하는데 history.push 해도 url만 바뀌고, 새로고침은 안 되는 문제가 있었다.
검색을 통해 사용중인 react-router-dom 의 버전에 맞는 history 버전을 재설치해야한다고 하여 삭제 후 재설치를 했음에도 해결되지 않았는데,
history.push 대신 window.location.replace 를 이용했더니 해결이 되었다.
```js
const handleChangeNickname = async () => {
await axios({
method: "PATCH",
url: `${url}/user/mypage/nickname`,
data: {
nickname: nickname,
password: password,
},
headers: {
authorization: `Bearer ${state.accessToken}`,
},
})
.then(resp => {
resetErrorMsg();
setNickname(resp.data.data.userInfo.nickname);
console.log("수정 완료");
window.location.replace("/mypage"); // 이부분 !
alert("회원정보가 수정되었습니다.");
})
};
```
### 내일은 프로젝트에 기여하기 위해 무엇을 해야 하나요?
* [ ] 메인페이지 - 피아노 캔버스 마무리
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.