-
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
[정원식] Sprint 10 #293
The head ref may contain hidden characters: "Next-\uC815\uC6D0\uC2DD-Sprint10"
[정원식] Sprint 10 #293
Conversation
import { Article, ArticleDetailResponse } from '@type/ArticleTypes'; | ||
import { GetServerSideProps } from 'next'; | ||
|
||
export const getServerSideProps: GetServerSideProps = async (context) => { |
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.
import type { GetServerSidePropsContext } from 'next';
...
export async function getServerSideProps(context: GetServerSidePropsContext) {
이렇게 타입을 지정해줄 수 있어요~
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.
규칙은 아니지만, 일반적으로 getServerSideProps 함수가 아래에 배치되고, BoardDetailPage 컴포넌트가 상위에 존재하도록 코드를 작성합니다. 아래처럼요!
type BoardDetailPageProps = {
initArticle: ArticleDetailResponse;
};
const BoardDetailPage = ({ initArticle }: BoardDetailPageProps) => {
return (
<>
<BasicLayout>
<ArticleSection article={initArticle} />
<ArticleCommentForm articleId={initArticle.id} />
</BasicLayout>
</>
);
};
export const getServerSideProps: GetServerSideProps = async (context) => {
...
import AllArticlesBoard from '@components/board/AllArticlesBoard/AllArticlesBoard'; | ||
import BestArticlesSection from '@components/board/BestArticlesSection/BestArticlesSection'; | ||
import BasicLayout from '@components/layout/BasicLayout/BasicLayout'; | ||
import { getArticles } from '@lib/api/articleApi'; | ||
import { Article } from '@type/ArticleTypes'; |
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.
리뷰 반영 굳! 👍
머지 먼지 진행하고, 리뷰는 이어서 진행하도록 하겠습니다! |
요구사항
상품 등록 페이지
상품 상세 페이지
멘토에게