Home > Article > Web Front-end > How to jump out of a new page in react
React method to jump out of a new page: 1. Jump to the new page unchanged from the local page, the code is [const w=window.open('about:blank')]; 2. Click the local page on the page Open a new page, the code is [Back to login page].
The operating environment of this tutorial: windows7 system, React17 version, DELL G3 computer.
Recommended: react video tutorial
How to jump out of a new page in react:
##1. The local page does not change and jumps to the new page
<Button style={{backgroundColor:'#F0F2F5'}} onClick={this.handle} className="last-button" > handle=()=>{ const w=window.open('about:blank'); w.location.href="www.baidu.com" }
2. Click the local page to open a new page
Introducing the ant Button component<Button style={{backgroundColor:'#F0F2F5'}} onClick={()=>{window.location.href="https://baidu.com"}} className="r-button" >Introduction
import {Link} from 'react-router-dom'
<Link to="/new/login/"> <Button className="e-button" type="primary">Back to login page</Button> </Link>
Related free learning recommendations: javascript Video tutorial
The above is the detailed content of How to jump out of a new page in react. For more information, please follow other related articles on the PHP Chinese website!