728x90 에러해결1 [React ERROR] 해결 React Hook "useState" cannot be called at the top level 간단 요약 Hook을 React 함수 컴포넌트 내부에서 호출해야 합니다. 문제상황 React에서 `useState`와 같은 Hook을 사용하면서 아래와 같은 에러 메시지를 마주치게 될 수 있습니다: Line 5:41: React Hook "useState" cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function react\-hooks/rules\-of\-hooks 에러가 발생하는 코드: import React, { useState, useEffect } from "react"; import Axios from "axios"; const [c.. 2023. 8. 18. 이전 1 다음 728x90