React history.push() is updating url but not navigating to it in browser

后端 未结 7 874
误落风尘
误落风尘 2020-12-13 16:50

I\'ve read many things about react-router v4 and the npm history library to this point, but none seems to be helping me.

My code is functioning as expected up to t

7条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-13 17:37

    Check if you don't have nested BrowserRouter tags.

    I had this issue on react-router v4 but I solved it after changing the app to only have the BrowserRouter at the top most level like the example below.

    ReactDOM.render(
      
        
      ,
      document.getElementById('root')
    );
    

提交回复
热议问题