728x90
반응형
문제
'string' 형식은 '--downlevelIteration' 플래그 또는 'es2015' 이상의 '--target'을 사용하는 경우에만 반복할 수 있습니다.ts(2802)
setCheckList(prev => [...id]);
스프레드 문법인 es6를 지원하지 않는 환경에서 작성하면 생기는 오류
해결
//tsconfig.json
"downlevelIteration": true
tsconfig.json 에 추가해주었다.
728x90
반응형
'TIL' 카테고리의 다른 글
타입스크립트 any, unknown (0) | 2023.02.26 |
---|---|
useEffect counter로 작동 순서 정리 (0) | 2023.02.21 |
react 오류 : Element type is invalid, expected a string (for built-in components) or a class/function but got : (0) | 2023.02.06 |
react) codebox에서 받은 파일 npm i 안 될 때 (0) | 2023.01.21 |
[Context] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment> (0) | 2023.01.21 |
댓글