Skip to content

Conversation

yeon0036
Copy link
Collaborator

@yeon0036 yeon0036 commented Jan 6, 2025

요구사항

기본

  • 스프린트 미션 5 ~ 7에 대해 typescript를 적용해주세요

심화

  • any 타입을 최소한으로 써주세요

주요 변경사항

  • js, jsx -> ts, tsx

스크린샷

image

멘토에게

  • 상위 컴포넌트인 App과 index는 아예 전체 오류가 발생하여 보류했습니다.
  • CommentTrread도 아직 미완성입니다.
  • 배운 내용을 토대로 타입 작성 위주로 했는데, 코드 자체에 대한 이해도가 부족해서인지 연결되어있는 부분에서 오류가 많이 나서 억지로 수정한 부분들이 많습니다. 그 부분들 위주로 코멘트 부탁드립니다.
  • Route, BrouseRoute 등의 부분에 아예 전체 오류가 발생합니다. 패키지 설치나 버전은 맞춰 놨는데 이외에 어디서 나는 오류인지 찾지 못했습니다 ㅠㅠ
  • 멘토링 시간에 전체적으로 같이 훑어봐주시면 감사하겠습니다 !

@yeon0036
Copy link
Collaborator Author

yeon0036 commented Jan 6, 2025

image 브랜치 모두 정리 잘 되었는데, 컨플릭이 왜 발생하는건가용..?

@yeon0036 yeon0036 added the 매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. label Jan 6, 2025
@yeon0036 yeon0036 requested a review from withyj-codeit January 6, 2025 15:59
@withyj-codeit
Copy link
Contributor

배운 내용을 토대로 타입 작성 위주로 했는데, 코드 자체에 대한 이해도가 부족해서인지 연결되어있는 부분에서 오류가 많이 나서 억지로 수정한 부분들이 많습니다. 그 부분들 위주로 코멘트 부탁드립니다.

해당하는 부분들이 어디인지 github에 코멘트로 남겨주셔야 쉽게 파악할 수 있을 것 같아요.

@withyj-codeit
Copy link
Contributor

기존 "React-정혜연" 브랜치에 sprint-6 내용이 있는데, 이를 pull 받고 sprint-8 브랜치를 만든 것이 아니라 커밋 헤드가 분리 돼서 머지 시도가 되지 않는 걸로 보여요.
기존에 완료했던 작업에서 TypeScript 적용하는 과정만 변경사항으로 볼 수 있도록 PR 다시 만들 수 있나요?

Copy link
Contributor

@withyj-codeit withyj-codeit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

스프린트 미션하느라 수고 많으셨어요~👏🏻
탬플릿 코드가 많은 걸로 보이는데, 조금 늦더라도 탬플릿 코드를 참고는 하되 최대한 본인이 직접 만들어 보면 좋을 것 같아요.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

타입스크립트 파일로 변환해보면 좋을 것 같아요.

const [isDropdownVisible, setIsDropdownVisible] = useState(false);

const toggleDropdown = () => {
setIsDropdownVisible(!isDropdownVisible);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setIsDropdownVisible((prev) => !prev)
이렇게 간단한 경우는 문제 없지만, 로직이 복잡해지면 이전 상태값을 받는다는 보장이 없어서 prev 값을 가져와서 변경하는게 더 안전해요. (참고)

onSortSelection: (sortOption: string) => void;
}

function DropdownMenu({ onSortSelection }: onSortSelectionValue) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 드롭다운은 최신순, 인기순 만 담을 수 있는 컴포넌트인데,
많은 프로젝트에서 드롭다운 컴포넌트를 동일한 ui를 가지고 다양한 곳에서 사용하기도 해서
다른 선택지가 들어오는 경우에도 사용할 수 있는 조금 더 일반적인 ui 컴포넌트를 만든다면 어떻게 만들지 고민해보고 리팩토링 해봐도 좋을 것 같아요.

return (
<Container>
<ItemProfileSection product={product} />

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아래에도 있는데 불필요한 여백으로 보여요.

@withyj-codeit withyj-codeit merged commit b3a71e3 into codeit-bootcamp-frontend:React-정혜연 Jan 22, 2025
@withyj-codeit
Copy link
Contributor

withyj-codeit commented Jan 22, 2025

  • 상위 컴포넌트인 App과 index는 아예 전체 오류가 발생하여 보류했습니다.
  • 배운 내용을 토대로 타입 작성 위주로 했는데, 코드 자체에 대한 이해도가 부족해서인지 연결되어있는 부분에서 오류가 많이 나서 억지로 수정한 부분들이 많습니다. 그 부분들 위주로 코멘트 부탁드립니다.
  • Route, BrouseRoute 등의 부분에 아예 전체 오류가 발생합니다. 패키지 설치나 버전은 맞춰 놨는데 이외에 어디서 나는 오류인지 찾지 못했습니다 ㅠㅠ

해당 부분들 아직 해소되지 않으셨으면 저한테 디스코드 메세지 남겨주셔요. 시간 조율해서 같이 봐 드릴게요.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants