본문 바로가기
Study/Node&React_youtube

[노드/리액트 유튜브] #14~15. 댓글 기능 생성 (1)구조, (2)Comment.js

by 이지이즤 2022. 2. 18.

**본 포스팅은 유튜브&인프런 John Ahn님의 노드 리액트 유튜브 클론 강의를 참고하여 작성하였습니다.**

 

 

Make the Comment (1)구조

 


1. 구조

  • comment list : 댓글 달린 부분
    -> single comment : 댓글 하나하나 (사용자 정보, 내용, form, 좋아요싫어요기능, 대댓글)
    -> reply comment : 대댓글 (depth가 무한히 커질 수 있음)
  • root comment form : 첫번째 depth인 댓글 입력하는 칸
    예시

2. Comment model 생성
3. 비디오 디테일 페이지에 Comment Component 만들기

 

 


Make the Comment (2)Comment.js

 

 

1. Comment.js template 만들기
1.
2. handleClick func 만들기
3. onSubmit func 만들기

4. parent component 는 VideoDeatilPage.js 의 Comments state 를 의미함

 

결과

 

댓글