简体   繁体   中英

Any cleaner way to trigger React Route change?

I am pretty new to React-Router, I wonder if there is a simple way to change Route, some concept like state in Angular UI Router. From the React Router official tutorial :

https://github.com/reactjs/react-router-tutorial/tree/master/lessons/12-navigating

My understanding is: I have to manually change the url to trigger route change.

What exactly are you trying to achieve? Did you take at look at the react-router Link component?

Perhaps the most used component in your app is Link. Its almost identical to the <a/> tag you're used to except that its aware of the Router it was rendered in.

React-Router Tutorial / Lesson 3: Navigating with Link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM