#2주차 - Mission3 입력에 따라 늘어나는 폼

sykim·2020년 4월 14일
0

[Week2] 3기 - Mission1,2 필수 구현사항

  1. (완료) 코멘트폼과 포스트폼에서 글자자가 길어지면 자동으로 폼의 높이가 길어지게 하는 기능을 추가해보세요!

  2. (부분 완료)

  3. (진행 중) connected-react-router를 적용 https://github.com/supasate/connected-react-router
    코멘트를 단 친구의 이름을 클릭하면 해당 친구의 포스트들이 보여지게 해보세요.

Mission1 review

  1. 포스트 입력창과 댓글 입력창 둘 다 늘어나는 기능이 같은 것 같아 해당 부분은 커스텀훅으로 묶어서 공통으로 사용해보았습니다. 다만 setValue 를 다른 함수에서 사용해야하는 경우가 애매해졌습니다. 이 부분은 질문으로 자세히 드리겠습니다.
  2. rootAction, rootSelector 부분은 이해가 부족해 주신 구조대로 구현하지 못했습니다. 질문을 하면서 진행해야 될 것 같아 PR 먼저 드립니다. (ㅜㅜ)

question list

Q1. custom hook

useInput이라는 함수는 입력값과 높이값, ref 값을 받아 handelr 함수에서 입력폼 높이를 조절합니다.

The function useInput takes input value, height and ref values ​​and adjusts the input form height in the handelr function.

그리고 저는 submit 함수에서 입력값을 초기화시키고 싶습니다. 그런데 커스텀훅 안에 setValue가 지정되어 있어서 submit 함수에서 value 값 초기화가 불가능합니다.
이 경우엔 커스텀훅을 사용하지 않는게 맞는건가요?

And I want to initialize the input value in submit function.
However, since setValue is specified in the custom hook, it is impossible to initialize the value value in the submit function.

In this case, is it correct not to use a custom hook?

(issued file list
hocs > customHocs.js
Home > CommentForm.js, PostForm.js


Q2. How to use rootSelector


표시된 부분을 selectors.js 로 빼서 어떻게 파일로 불러와야할지 잘 모르겠습니다.
I am not sure how to subtract the marked part with selectors.js to load it into a file.


Q3. why comment store is seperated

comment store가 왜 따로 분리되어있는지 알고 싶습니다. comment store의 용도가 뭔가요?

I want to know why the comment store is separated. Because i have a commentList in each post in the post store.
What is the purpose of the comment store?

profile
블로그 이전했습니다

0개의 댓글