How to use react-router 4.0 to refresh current route? not reload the whole page

后端 未结 7 2115
暖寄归人
暖寄归人 2021-01-01 19:35

\'react-router-dom\' has refresh function here, but I don\'t know how to call this method, also their well formatted document doesn\'t bother to explain this.

windo

7条回答
  •  伪装坚强ぢ
    2021-01-01 20:11

    I have the same problem and I have no clue how the refresh does. My solution is to do following two steps.

    1. push new path to history
    2. reset all states

    Then the DOM will rerender with your route.

提交回复
热议问题