Conversation
| const [target] = filterChannelSameId({ channels, id }); | ||
| return ( | ||
| target ?? | ||
| ({ |
There was a problem hiding this comment.
변수로 분리하면 좋을거 같아요!
예시: EmptyChannel
| const imgRef = useRef<HTMLInputElement>(null); | ||
| const handleClickButton = () => { | ||
| const teamId = 1; | ||
| const name = nameRef.current!.value; |
There was a problem hiding this comment.
! 사용하신 이유가 무조건 값이 들어있기에 사용하신 걸까요??
There was a problem hiding this comment.
본래 ref.current.value를 사용하려면 type checking을 진행해야합니다.
if(!nameRef.current) return;
const value = nameRef.current.value
하지만 말씀해주신 것 처럼 무조건 nameRef.current는 dom을 참조하고있기에 !를 사용하여 value를 강제로 꺼내왔습니다.
다른방법으로는 as를 사용해줄 것 같은데요, 코드가 더 길어지는것보단 간결해보여서 사용했습니다.
There was a problem hiding this comment.
답변해주셔서 감사합니다!
보통 !은 eslint 에러를 해결하기 위해 많이 사용한다고 해서요! 이 부분에서는 !하신게 더욱 간결한거 같군요!!
| import { UseTeamListResult } from '@Page/MainPage/MainPage.type'; | ||
|
|
||
| export type TeamCreateModalProps = { | ||
| handleAddTeam: UseTeamListResult[1]; |
There was a problem hiding this comment.
결과타입을 배열로 주신 부분이 궁금해요!
단순히 해당타입만 봤을 때 인덱스로 주신다면 어떤 타입인지 감이 오지 않아서요!
There was a problem hiding this comment.
네 저도 이부분을 상당히 고민하고있었는데요, 마땅한 해결책이 떠오르지 않아서요, 뭔가 ts의 util type을 사용하면 될 것 같긴한데 알아봐야겠네요.
There was a problem hiding this comment.
모든 result type을 []로 사용하지않고 {}로 변경하였고, Pick을 사용해서 해결하였습니다~
| const src = | ||
| name === 'General' | ||
| ? select | ||
| ? '/asset/GeneralChannelIcon.svg' |
There was a problem hiding this comment.
넵 좋아요~ 디자인팀 데이터도 다른거같은데 적용해두겠습니다
| id='ChannelItem' | ||
| data-id={dataId} | ||
| className={ | ||
| select ? `${ChannelBasicClassName} bg-select-rgba rounded-lg` : `${ChannelBasicClassName}` |
There was a problem hiding this comment.
ChannelBasicClassName + select?'bg-select-rgba rounded-lg':''로 표기하시는 건 어떤가요?
| }; | ||
|
|
||
| useEffect(() => { | ||
| getTeams() |
What is this PR?
Changes
ScreenShot
2022-10-03.2.55.33.mov
Discussion
Test CheckList