history.push가 작동하지 않았던 이유

LANA·2020년 12월 30일
0

이틀간 골머리앓던 문제가 BrowserRouter as 를 지움으로 해결되었다.

history library를 설치하고, createBrowserHistory를 적용해 history를 모듈화했다. 그런데 history.push가 작동되지 않았다.

해답은 BrowserRouter는 그 자체의 history instance를 만들어내기 때문에 createBrowserHistory를 혼용할 수 없다.

출처: 스택오버플로우

profile
Let's code like chord !

0개의 댓글