React-router JS Control Routing Jump

Source: Internet
Author: User

React-router JS Control Routing Jump

React-router control the way of routing jumps, currently know there are two [link link, and JS control jump], but the most common is to use Link (like a tag), to jump

JS Implementation method

Because sometimes need to click on a tag, or a button, to dynamically implement the page jump address, this need to use JS to achieve

The code implemented is simple

Note: If it is a component that is returned based on a routing rule, the props contains the history attribute, and if not, there is no attribute.

React-router JS Control Routing Jump

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.