refactor: #137/api 함수 에러 처리 & data fetching 시 로딩, 에러 처리#138
Merged
codeit-kkm merged 2 commits intomainfrom Apr 16, 2025
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
ARON-Y
approved these changes
Apr 16, 2025
| } | ||
| }; | ||
|
|
||
| if (loading) return <p>Loading...</p>; |
Collaborator
There was a problem hiding this comment.
로딩 상태 표시 좋네요! 다만 단순히 텍스트를 표시하는 대신에 로딩 스피너나 스켈레톤을 넣어서 UI가 자연스럽게 표시되도록 하는 방법도 좋겠어요!
Owner
Author
There was a problem hiding this comment.
맞아요 우선은 loading 상태 사용을 위해서 임시로 이렇게 해놨는데, 금요일 리팩토링 때 아름님이 말씀하신 것처럼 스켈레톤을 사용하거나 하는 식으로 UI를 바꿔볼 생각입니다!
| color: selectedColor, | ||
| id, | ||
| }); | ||
| setLoading(true); |
Collaborator
There was a problem hiding this comment.
저도 이 부분 고민중인 부분이에요..! setLoading(true)와 setLoading(false)가 여러 곳에서 반복적으로 사용되니까 custom hook으로 분리해서 사용하는 방법을 고민하고 있었어요..!
Owner
Author
There was a problem hiding this comment.
확실히 반복되는 코드가 많더라구요... 커스텀 훅이 있어도 좋겠네요!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#️⃣ Issue Number
#137
📝 요약
Loading...문구가 나오도록 간단하게 로딩 처리를 해서 데이터를 불러올 때 layout shift가 있는 부분이 있어 수정이 필요합니다.🛠️ PR 유형