-
Notifications
You must be signed in to change notification settings - Fork 38
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
The head ref may contain hidden characters: "React-\uC815\uC778\uC7AC-Spirnt8"
[정인재] spirnt8 #248
Conversation
There was a problem hiding this 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> |
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alias path를 사용해보시는 것을 추천드립니다.
items.map((item) => { | ||
return <CommentListItem key={item.id} item={item} />; | ||
}) |
There was a problem hiding this comment.
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} />
)
const [totalCount, setTotalCount] = useState(1); | ||
const [currentPage, setCurrentPage] = useState(1); | ||
const [pageSize, setPageSize] = useState(10); | ||
const [totalPages, setTotalPages] = useState(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이렇게 관련 있는 상태끼리는 하나의 객체로 묶어서 관리해주시는 것도 좋습니다.
요구사항
멘토에게