Conversation
yejinleee
reviewed
Dec 11, 2023
Collaborator
yejinleee
left a comment
There was a problem hiding this comment.
정합성 체크도 하시고 배포까지 .. ! 역시 익준님 👍👍
타입관련되서 궁금증이 좀 많아졌는데, 익준님의 답변두 궁금하고 같이 고민할만한 것들은 내일 더 얘기해봅시다 !!
수고하셨어요 !!
Comment on lines
+6
to
+7
| export const $app: QuerySelectType<HTMLElement> = | ||
| document.querySelector('.app'); |
Collaborator
Author
There was a problem hiding this comment.
아 이건 아래 쪽에서 new APP 컴포넌트를 생성할 때 $target: $app 타겟으로 해당 $app 요소와 타입을 동시에 넘겨줘야 해서 export 했습니다.
Comment on lines
+14
to
+15
| const $header: QuerySelectType<HTMLHeadingElement> = | ||
| document.createElement('h1'); |
Collaborator
There was a problem hiding this comment.
const $header: HTMLHeadingElement = document.createElement("h1"); 와 뭐가 다를까요 ??
저는 const $header = document.createElement('h1'); $target && $target.appendChild($header); 이렇게 참 검사를 통한 내로잉 을 주로 사용했는데 , 어떤 방식이 더 나을까요?
Collaborator
Author
There was a problem hiding this comment.
이건 createElement에 대해서도 제가 잘못 타입을 지정한 거 같네요! 굳이 타입을 지정하지 않아도 HTMLHeadingElement 타입이 추론되는 거 같습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 설명
VanillaJS 3주차 과제 Todo App을 TypeScript로 변환
🚀배포 링크
https://fedc-5-learning-ts-study.vercel.app/
✅ PR 포인트 & 궁금한 점
this: any와 new 생성자를 통해 생성할 때as any로 단언하여 임시 해결globalTypes라고 명명했습니다.따로 정해져 있는 관례가 있을까요?