
vue3 와 typescript로 개발중 'Object is possibly undefined' 에러가 발생했다. 딱 보아하니 'props로 땡겨온 변수가 undefined 일 수 있잖아' 라는 에러 같았다. 하지만 나는 해당 변수의 default 까지 선언을 해준 상황이라 절대 undefied 혹은 null 값이 될 수 없는 상황이였다.. 이를 해결하기 위해 해당 변수가 undefined 될 수 없다고 강제 하기로 했고, 느낌표(!) non-null 단어 연산자를 사용했다.사용법은 간단히 변수 옆에 !를 붙여주면 된다. 이는 확정 할당 단언(Definite Assignment Assertions) 이라고 한다. 변수에 값이 무조건 할당되어있다고 컴파일러에게 전달하여 값이 없어도 변수 또는 객체를 사용할..
프론트엔드/Vue.js
2022. 11. 18. 10:36
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- eslint
- react ref reative
- Vue.js
- vue reactive
- vue
- react 3d 에니메이션
- react 3d animation
- react leva
- react setstate
- 394. decode string js
- react lane
- renderlane
- react three fiber leva
- leva
- react vue
- vue react
- react 3d
- react fiber 3d
- vue ref
- three.js leva
- react batch
- 394 decode string
- [leetcode] 394. decode string
- 394. decode string javascript
- [leetcode] 394. decode string js
- react 3d text
- react 배치
- 리액트 배치
- vue3
- react three fiber
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함