Project12-C-Slack-Web icon indicating copy to clipboard operation
Project12-C-Slack-Web copied to clipboard

[FE] custom hook κ°œμ„ 

Open bell-won opened this issue 4 years ago β€’ 0 comments

  • custom hook λ‚΄λΆ€μ˜ μƒνƒœκ°’μ€ κ³΅μœ λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
  • λ³„κ°œμ˜ μ»΄ν¬λ„ŒνŠΈμ—μ„œ custom hook을 μ‚¬μš©ν•˜κ²Œ 되면 μ»€μŠ€ν…€ ν›… μ‚¬μš©νšŸμˆ˜ 만큼 useEffectκ°€ λ°œμƒν•©λ‹ˆλ‹€. 예λ₯Ό λ“€μ–΄μ„œ 채널 변경이 λ˜μ—ˆμ„ λ•Œ chatRoom, socket, channelHeaderμ—μ„œ useChannelInfo 훅을 μ‚¬μš©ν•˜λ―€λ‘œ 3번의 api μš”μ²­μ΄ λ°œμƒν•˜κ³  μžˆμ–΄μš”. λ‹Ήμ—°ν•œ 결과인데 생각을 λͺ»ν•˜κ³  μžˆμ—ˆλ„€μš”..

bell-won avatar Dec 19 '20 20:12 bell-won