Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
useEffect(()=> {
const checkedItems = checkboxRefs.reduce<TCart[]>((res, ref, i)=> {
if(ref.current!.checked) res.push(items[i])
return res
}, [])
setCheckedCartState(checkedItems)
}, [items, formData])
=> Hook의 규칙을 어기고 useEffect의 위치를 잘못 넣어서 나는 오타 에러.
'error 처리' 카테고리의 다른 글
GraphQLError: Syntax Error: Expected Name, found "$" (0) | 2023.01.01 |
---|---|
[vue] Property 'props' does not exist on type '{}' (ts 2339) (0) | 2022.10.24 |
[node] node 삭제 및 nvm이용해 node 설치하기(feat. brew) (0) | 2022.10.14 |
UNMET PEER DEPENDENCY 에러시 (0) | 2022.01.24 |
[Vue Error] Consider upgrading your version of 'tslib' (0) | 2021.06.01 |