Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.4k 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 OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...