useNavigate() may be used only in the context of a <Router> component 오류

김선주·2022년 1월 20일
0
useNavigate may be used only in the context of a <Router> component. at invariant (index.tsx:19:1)

Navbar에 useNavigate를 썼는데,
오류가 뜨고 창이 뜨지 않았다..........

useNavigate()는 Router 구성 요소의 컨텍스트에서만 사용할 수 있습니다.


Navbar/ 가 BrowserRouter안으로 들어가니 창이뜨고 오류가 해결됐다.

profile
김선주입니다.

0개의 댓글