BrowserRouter vs Router with history.push()

前端 未结 2 1553
被撕碎了的回忆
被撕碎了的回忆 2020-12-28 12:46

I am trying to understand the difference between BrowserRouter and Router of the react-router-dom (v5) package and what difference it

2条回答
  •  孤独总比滥情好
    2020-12-28 13:24

    BrowserRouter ignores the history prop as it handles the history automatically for you. If you need access to the history outside of a react component, then using Router should be fine.

提交回复
热议问题