Programmatically navigate using react router

后端 未结 30 2438
無奈伤痛
無奈伤痛 2020-11-21 05:18

With react-router I can use the Link element to create links which are natively handled by react router.

I see internally it calls t

30条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-21 05:41

    If you are using hash or browser history then you can do

    hashHistory.push('/login');
    browserHistory.push('/login');
    

提交回复
热议问题