error4 트러블 슈팅(리액트 렌더링에 관한 이슈) 문제 타이머를 만들어주고 화면에 렌더링 하는 과정에서 1초 단위로 변경되는 것이 아니라 위에서부터 아래까지 점차 딜레이가 걸리는 듯한 현상이 나타남. 또한, 남은시간이 0인 상품 아래에 나오는 상품들은 아예 타이머가 작동하지 않는 것처럼 보이는 현상이 발생함. 원인 1. 불필요한 리렌더링이 발생하고 있었다. 2. useEffect 내에서의 불필요한 계산 코드가 있어 1초마다 호출했는데 이게 매번 동일한 결과를 반환하지 않았다. 해결방법 1. useMemo를 이용한 객체 캐싱 : endTime이 변경될 때만 새로 생성되도록 함으로서 기존 캐시된 값이 사용되므로 불필요한 리렌더링이 방지된다. 코드 작성 import { useState, useEffect, useMemo } from "react"; impor.. 2023. 10. 14. 실전 프로젝트 트러블 슈팅 (비동기 관련) 에러코드 React Router caught the following error during render TypeError: Cannot read properties of undefined (reading 'map') at AuctionList (AuctionList.tsx:67:22) at renderWithHooks (react-dom.development.js:16305:18) at mountIndeterminateComponent (react-dom.development.js:20074:13) at beginWork (react-dom.development.js:21587:16) at beginWork$1 (react-dom.development.js:27426:14) at performUnitO.. 2023. 10. 10. create react app 중 오류 npm ERR! code ENOENT npm ERR! syscall open npm ERR! path C:\Users\AI\Desktop\js chrome clone app/package.json npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\AI\Desktop\js chrome clone app\package.json' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent npm ERR! A complete log of this run can be found in: npm ERR! C:\Users.. 2023. 8. 25. 파이썬 requests 설치 오류 requests 설치 과정 중 UnicodeDecodeError : 'cp949' codec can`t decode byte 0x80 in position 18: illegal multibyte sequence 구글에 찾아보니 인코딩 과정에서의 오류이고 해결방법은 아래 링크 참고. 참고사이트 : https://no-start.tistory.com/77 [에러] vscode 터미널에서 pip install 오류(cp949) 에러 상태, 해결방안 UnicodeDecodeError: 'cp949' codec can't decode byte 0xeb in position 16: illegal multibyte sequence 어제 조코딩 웹크롤링 강의(클릭)를 듣고 있는데, 가상환경으로 경로를 잡고 터미널에 p.. 2023. 8. 24. 이전 1 다음