使用react-router-dom,history.goBack(),默认就是返回上一个页面。感觉题主表述不是很合适,组件A/B跳转到组件C,组件之间怎么跳转呢?应该是组件所在的页面进行跳转。 history在history包下,引入方式: // 如果使用hashHistory import history from 'history/createHashHistory' // 如果使用createBrowserHistory import history from 'history/createBrowserHistory' // 使用方式 history.goBack(); 更详细的API介绍:https://reacttraining.com/rea...
使用react-router-dom,history.goBack(),默认就是返回上一个页面。感觉题主表述不是很合适,组件A/B跳转到组件C,组件之间怎么跳转呢?应该是组件所在的页面进行跳转。
history在history包下,引入方式:
更详细的API介绍:https://reacttraining.com/rea...