Skip to content
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

[FE] custom hook 개선 #201

Open
bell-won opened this issue Dec 19, 2020 · 0 comments
Open

[FE] custom hook 개선 #201

bell-won opened this issue Dec 19, 2020 · 0 comments
Assignees

Comments

@bell-won
Copy link
Collaborator

  • custom hook 내부의 상태값은 공유되지 않습니다.
  • 별개의 컴포넌트에서 custom hook을 사용하게 되면 커스텀 훅 사용횟수 만큼 useEffect가 발생합니다. 예를 들어서 채널 변경이 되었을 때 chatRoom, socket, channelHeader에서 useChannelInfo 훅을 사용하므로 3번의 api 요청이 발생하고 있어요. 당연한 결과인데 생각을 못하고 있었네요..
@bell-won bell-won self-assigned this Dec 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant