-
Notifications
You must be signed in to change notification settings - Fork 45
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
[김은재] Week14 #459
The head ref may contain hidden characters: "part3-\uAE40\uC740\uC7AC-week14"
[김은재] Week14 #459
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
은재님 깔끔하게 작업 잘 해주셨네요!
새로운 라이브러리 적용하기 어려우셨을텐데 심화 부분까지 적용해주시고 굿 👍🏽
다음주도 화이팅입니다!
ref={() => { | ||
selectedFoler.current[i] = navItem.id; | ||
}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ref 를 여기서 전달하는건 어떤 목적이에요??
const SHARE_OPTION = [ | ||
{ | ||
keyId: "kakaotalk", | ||
img: icon_share_kakao, | ||
imgAlt: "카카오톡 아이콘", | ||
buttonName: "카카오톡", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
훨씬 좋네요 👍🏽
return ( | ||
<> | ||
{SHARE_OPTION.buttonName.map((shareOptionBtn, i) => { | ||
{SHARE_OPTION.map((itme) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오타!
{SHARE_OPTION.map((itme) => { | |
{SHARE_OPTION.map((item) => { |
const snsInfo = [ | ||
{ | ||
url: "https://www.facebook.com/", | ||
img: icon_facebook, | ||
imgAlt: "페이스북 아이콘", | ||
}, | ||
{ | ||
url: "https://twitter.com/", | ||
img: icon_twitter, | ||
imgAlt: "트위터 아이콘", | ||
}, | ||
{ | ||
url: "https://www.youtube.com/", | ||
img: icon_youtube, | ||
imgAlt: "유튜브 아이콘", | ||
}, | ||
{ | ||
url: "https://www.instagram.com/", | ||
img: icon_instagram, | ||
imgAlt: "인스타그램 아이콘", | ||
}, | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분은 컴포넌트 렌더링 될 때마다 매번 선언될 필요가 없어서 컴포넌트 바깥으로 빼도 될 것 같아요!
validate?: (value: string) => Promise<boolean | string>; | ||
} | ||
|
||
let InputOption: IInputType = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
재할당 할 일이 없다면 const 를 사용해주세요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
상수의 경우 따로 타입 (IInputType) 정의하지 않고 as const
키워드를 사용할 수도 있습니다
- 타입을 명시적으로 정의하지 않고 타입스크립트가 추론하도록 했을 때와
- 타입을 명시적으로 정의했을 때와 (지금 작성한 방식)
- as const 를 사용했을 때
의 타입이 어떻게 달라지는지 확인해보세요!
useEffect(() => { | ||
try { | ||
const token = localStorage.getItem("userToken"); | ||
setAuth(token); | ||
} catch (error) { | ||
console.error("Error fetching token:", error); | ||
} | ||
}, []); | ||
if (auth) router.replace("/folder"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분 코드 반복되는데 커스텀훅으로 분리할 수 있겠네요!
margin-top: 24px; | ||
`; | ||
|
||
export const PassWrodBox = styled.div` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export const PassWrodBox = styled.div` | |
export const PassWordBox = styled.div` |
/*. | ||
.password-wrap > .pwd-eye-on { | ||
background-image: url('/img/icon/eye-on.png'); | ||
height: 10.91px; | ||
} | ||
|
||
.validation{ | ||
padding-top: 6px; | ||
font-size: 14px; | ||
font-weight: 400; | ||
color: var(--var-test-red); | ||
line-height: 16.8px; | ||
} | ||
|
||
.emailBlank, .emailFormCheck, .emailCheck, .pwdBlank, .pwdCheck { | ||
padding-top: 6px; | ||
display: block; | ||
} | ||
|
||
|
||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
미사용 코드 삭제!
@@ -1,5 +1,7 @@ | |||
export interface ButtonProps { | |||
children: string; | |||
btnType?: "button" | "submit" | "reset" | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
옵셔널 (?
) 로 지정했다면 undefined 일 수 있다는 의미이므로 undefined 를 작성하지 않아도 됩니다
btnType?: "button" | "submit" | "reset" | undefined; | |
btnType?: "button" | "submit" | "reset"; |
pageType: string; | ||
type: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pageType 은 'signUp' | 'signIn' 이 사용되는 것 같고
type 도 사용하는 값이 몇 개 중 정해져있는 것 같은데
그렇다면 string 보다는 문자열 유니온으로 타입을 좁히는 것이 더 정확하게 타입스크립트를 사용하는 방법입니다!
요구사항
기본
심화
주요 변경사항
멘토에게