console.log("hello yeonniverse");
close
프로필 배경
프로필 로고

console.log("hello yeonniverse");

  • 분류 전체보기 (65)
    • React DeepDive (3)
    • JS&TS DeepDive (1)
    • CodingTest DeepDive (4)
    • IT (4)
    • Upscaling (11)
    • READERS AREA (1)
    • UOS (41)
      • UOS@SW APP (9)
      • UOS@DB (14)
      • UOS@운영체제 (18)
  • 홈
  • 태그
  • 방명록

13. 리액트에서 사용하는 타입스크립트

HTML 타입 const usernameInput = document.getElementById('username') as HTMLInputElement; const submitButton = document.getElementById('submit') as HTMLButtonElement; 다음과 같이 HTML태그Element 형태로 DOM 노드에 대한 타입을 사용 가능. 이벤트 타입의 경우 이벤트에 따라 다양하게 있는데, 뭐 onClick의 경우 MouseEvent임. VSCode에서 하나씩 찾아보면 됨! React 타입 Prop : 인터페이스 이용 interface Props { className?: string; id?: string; children?: ReactNode; onClick: (e:..

  • format_list_bulleted Upscaling
  • · 2024. 4. 17.
  • textsms

12. TS(타입스크립트) 기본 문법 및 타입 정리

TS에서는 변수의 타입을 지정해줘야 한다! JS에서는 아무렇게나 선언하고 초기화하고 바꿔도 상관없지만, TS에서는 그러면 맴매 맞는다! 타입지정 : 기본 자료형들 String, Number, Boolean, Undefined, Null -> 여기서 뒤에 []를 붙여 배열, [number, string] 등을 붙여 튜플 자료형을 지정할 수 있음. 타입 지정 : 객체 let product: { id: string; price: number; membersOnly?: boolean; // 필수가 아닌 프로퍼티 sizes: string[]; } = { id: 'c001', price: 129000, sizes: ['M', 'L', 'XL'], }; if (product.membersOnly) { console...

  • format_list_bulleted Upscaling
  • · 2024. 4. 17.
  • textsms
  • navigate_before
  • 1
  • navigate_next
전체 카테고리
  • 분류 전체보기 (65)
    • React DeepDive (3)
    • JS&TS DeepDive (1)
    • CodingTest DeepDive (4)
    • IT (4)
    • Upscaling (11)
    • READERS AREA (1)
    • UOS (41)
      • UOS@SW APP (9)
      • UOS@DB (14)
      • UOS@운영체제 (18)
최근 글
인기 글
태그
  • #알고리즘
  • #BOJ
  • #TS
  • #백준
  • #타입스크립트
  • #프론트엔드
  • #리액트 상태관리
  • #TypeScript
  • #React
  • #리액트
전체 방문자
오늘
어제
전체
Copyright © 쭈미로운 생활 All rights reserved.
Designed by JJuum

티스토리툴바