'Uncaught Error: useLocation() may be used only in the context of a <Router> component.' 에러 해결방법 MBTI 테스트 같은 테스트를 만들고 있는 과정에서 home 페이지에서 test 페이지로 그리고 test 페이지에서 result 페이지로 이동할 때 매끄러운 Page Transition을 주기 위해서 AnimatePresence를 Router에 사용했는데 그 때 에러가 발생했다. App.tsx function App() { const location = useLocation(); return ( ); } 맨 처음에는 이런 식으로 코드를 짰는데 계속해서 'Uncaught Error: useLocation() may be used only in the context of a component.' 에러가 발생했다. 그래서 구글링을 통해 StackOverFlow 에서 해결 방법을 찾아낼 수 있었다. 답변은 in.. 이전 1 다음