• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    미해결

도와주세요!!ㅠㅠ

20.08.25 05:18 작성 조회수 160

0

안녕하세요~

강사님 깃헙도 참고하고 다른분들 깃헙도 참고하면서 오류를 찾아 2번째 뎁스에 있는 코멘트가 왜 안보여지나 찾아내려고 했는데,  여러번 처음부터 다시해보고도 했는데, 계속 똑같은 오류로 해결하지 못했어요...

도와주시면 정말 감사하겠습니다!

(이미지는 똑같은 오류라 같은것으로 올립니다)

https://github.com/lhj1004ss/youtube_clone

한번 

https://github.com/lhj1004ss/youtube_clone

답변 2

·

답변을 작성해보세요.

3

앗 ㅠㅠ    

const renderReplyComment = (parentCommentId) => {

이부분에  {  } 이걸로 하면 return 넣어 주셔야 하고 아니면 {} 이거를 빼주셔야 렌더링 됩니다 ㅠㅠ 

const renderReplyComment = (parentCommentId) => {
return props.commentList.map((comment, index) => (
<React.Fragment>
{comment.responseTo === parentCommentId && (
<div style={{ width: "80%", marginLeft: "30px" }}>
<SingleComment
key={index}
refreshFunction={props.refreshFunction}
comment={comment}
postId={props.videoId}
/>
<ReplyComment
commentList={props.commentList}
postId={props.videoId}
parentCommentId={comment._id}
refreshFunction={props.refreshFunction}
/>
</div>
)}
</React.Fragment>
));
}

이거나 

const renderReplyComment = (parentCommentId) =>
props.commentList.map((comment, index) => (
<React.Fragment>
{comment.responseTo === parentCommentId && (
<div style={{ width: "80%", marginLeft: "30px" }}>
<SingleComment
key={index}
refreshFunction={props.refreshFunction}
comment={comment}
postId={props.videoId}
/>
<ReplyComment
commentList={props.commentList}
postId={props.videoId}
parentCommentId={comment._id}
refreshFunction={props.refreshFunction}
/>
</div>
)}
</React.Fragment>
));

이런식으로 해주세요 ㅠㅠ  

이런 세세한게 발견하기 어려운거같아요 수고하셨습니다 ^^;;!

0

newCode님의 프로필

newCode

질문자

2020.08.27

정말 감사합니다! 얼른 마무리하고 쇼핑몰로 넘어가도록 하겠습니다!