Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
950 views
in Technique[技术] by (71.8m points)

react 用history 进行路由跳转。地址拦发生了改变,但是页面没有更新?

react 用history 进行路由跳转。地址拦发生了改变,但是页面没有更新?
import { createBrowserHistory } from 'history'

const history = createBrowserHistory()

history.push({pathname:this.state.jumpTo})


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

history.go()
跳转之后加上这句代码可以实现跳转。
不知道你最后的解决办法是什么?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share

2.1m questions

2.1m answers

31 comments

40.8k users

...