Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[정인재] spirnt8 #248

Conversation

Injaeeee
Copy link
Collaborator

@Injaeeee Injaeeee commented Aug 2, 2024

요구사항

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

멘토에게

  • 전 스프린트 미션을 수행한것 까지만 typescript 적용했습니다. 나머지 부분은 추후에 차근차근 진행하겠습니다!
  • 셀프 코드 리뷰를 통해 질문 이어가겠습니다.

@Injaeeee Injaeeee requested a review from jyh0521 August 2, 2024 13:57
@Injaeeee Injaeeee added 매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. 미완성🫠 죄송합니다.. labels Aug 2, 2024
Copy link
Collaborator

@jyh0521 jyh0521 left a comment

Choose a reason for hiding this comment

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

과제하느라 고생하셨습니다! 👍

<BrowserRouter>
<Routes>
<Route path="/" element={<RootLayout />}>
<Route index></Route>
Copy link
Collaborator

@jyh0521 jyh0521 Aug 3, 2024

Choose a reason for hiding this comment

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

컴포넌트가 단독으로 쓰일때는 <Route /> 이런식으로 쓸 수 있습니다.

@@ -0,0 +1,51 @@
const BASE_URL = "https://panda-market-api.vercel.app";
Copy link
Collaborator

Choose a reason for hiding this comment

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

base url은 .env 파일에 넣고 .gitignore에 추가해서 깃에 올라오지 않게 해주시면 보안상 이점이 있습니다.

}

export async function getProducts({
order = "recent",
Copy link
Collaborator

Choose a reason for hiding this comment

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

recent 같은 값은 상수로 관리해주시면 좋습니다.

import "./Button.css";

interface ButtonProps {
children?: ReactNode;
Copy link
Collaborator

Choose a reason for hiding this comment

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

children은 타입으로 넘겨주시지 않아도 사용하실 수 있습니다.

@@ -0,0 +1,72 @@
import { useEffect, useState } from "react";
import { getComment } from "../../api";
Copy link
Collaborator

Choose a reason for hiding this comment

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

alias path를 사용해보시는 것을 추천드립니다.

Comment on lines +59 to +61
items.map((item) => {
return <CommentListItem key={item.id} item={item} />;
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

return이 한줄인 경우는 다음과 같이 생략해서 작성하실 수 있습니다.

items.map((item) =>
  <CommentListItem key={item.id} item={item} />
)

Comment on lines +22 to +25
const [totalCount, setTotalCount] = useState(1);
const [currentPage, setCurrentPage] = useState(1);
const [pageSize, setPageSize] = useState(10);
const [totalPages, setTotalPages] = useState(0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

이렇게 관련 있는 상태끼리는 하나의 객체로 묶어서 관리해주시는 것도 좋습니다.

@jyh0521 jyh0521 merged commit 7500835 into codeit-bootcamp-frontend:React-정인재 Aug 3, 2024
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