일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
- Front-end
- swiftUI
- react
- frontend
- SWIFT
- JavaScript
- velog
- react-query
- 프론트엔드
- globalcommunity
- NextJs
- ios
- 프로그래머스
- iOSDeveloper
- error
- git
- 자바스크립트
- 회고
- TypeScript
- 알고리즘
- 코드트리챌린지
- 코드트리
- tshaped
- 코딩테스트실력진단
- 코딩테스트
- AppleDeveloperAcademy
- 프로젝트
- UIKit
- Xcode
- Apple Developer Academy
- Today
- Total
목록에러처리 (12)
Moon Work

Typescript와 React를 통해 간단한 ToDo 앱을 만드는데 props를 전달하는 과정에서 다음과 같은 에러가 발생했다. react-jsx-dev-runtime.development.js:87 Warning: ToDoItem: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props) children component에게 props로 key를 전달해..

javascript 개발: 뭐가 문제인지 모르겠다. typescript 개발: 뭐가 문제인지는 알 것 같다. 하지만 둘다 에러가 나는 것은 똑같다🙃 InstrinsicAttributes 에러 typesript와 redux를 활용해서 간단한 todo 앱을 개발하는 도중 callback함수를 prop로 전달하는 과정에서 InstrinsicAttributes 에러가 발생했다. 에러가 발생함에 감사하면서도 등산하는 것처럼 한발한발이 타입을 넘어가야 하는 것이 무겁기도 하다. 해결 방법 tsx에서는 props를 전달 받을 때 전달받을 인터페이스를 정의해주어야 한다. React.FC를 통해 제네릭으로 지정한 인터페이스를 전달해주면 jsx에서 props를 받을 때와 같이 받을 수 있다. ReactFC를 사용하지 않고..

타입스크립트에서 앞에서 조건문으로 값을 확인했음에도 type assertion을 쓰지 않으면 에러가 나는 경우가 있다. type assertion이 조금 폭력적인 방식이라 생각했지만 쓰지 않고는 코드가 너무 길어지거나 복잡해져서 type assertion을 쓸 수 밖에 없었다.🙃 오늘 js로 작성한 heap 알고리즘을 typscript로 변경하는 도중 다음과 같은 에러가 발생했다. while((this.heap[leftIndex] && this.heap[currentIndex] as number < this.heap[leftIndex] as number) || (this.heap[rightIndex] && this.heap[currentIndex] as number < this.heap[rightInde..

linked list 알고리즘을 typescript로 변경하는 중 다음과 같이 console을 찾을 수 없다는 에러를 찾았다. error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'. 53 console.log(linkedList.find(1)) 해결하는 방법은 아래 라인을 통해 @types/node를 설치해주면된다. npm install @types/node --save-dev 또는 아래와 같이 tsc --init으로 tsconfig.json을 생성하고 lib에 dom을 추가해주는 방법도 있다. "lib": ..