Cannot update a component (``) while rendering a different component (``).

Seonhee Kim·2023년 11월 6일

에러노트

목록 보기
9/11
Warning: Cannot update a component (``) while rendering a different component (``).
To locate the bad setState() call inside ``, follow the stack ~

start 와 end 가 같아지는 순간 탭 번호 0으로 이동시키려고 setCategoryNumber(0) 처리를 해놓았었는데, 그것을 useEffect 내부가 아닌 그냥 코드 내부에 해 놨기때문에 났던 에러였다.

이미 start, end를 비교해놓은 useEffect가 있어서 그 내부로 이동시켰더니 에러가 사라졌다.

profile
안녕하세요 ~_~

0개의 댓글