How to use js route redirection in react-router4.2?

1. There is a button on the page. Click this button to jump to the page

:withRouter

=
import React from "react"
import PropTypes from" prop-types"
import {withRouter} from "react-router"

class ShowTheLocation extends React.Component {
static propTypes = {

match: PropTypes.object.isRequired,
location: PropTypes.object.isRequired,
history: PropTypes.object.isRequired

}

render () {

const { match, location, history } = this.props

return (
  <div>You are now at {location.pathname}</div>
)

}
}

const ShowTheLocationWithRouter = withRouter (ShowTheLocation)

=
how to use this code in practical application?
withRouter is a high-level component? Return a ShowTheLocationWithRouter function? So how do you use jump in this function?

const {match, location, history} = this.props / / what does this line mean?

< H1 > use history.push ("/ xxx") like this? < / H1 >

now there is a button component how to add events to this component for routing redirection

Mar.15,2021

after you get the history, you can jump with code. ReactTraining/history: Manage session history with JavaScript this is the history repository. Check this document



import history from 'history'
history.push(path)
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea71d7-47bf4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea71d7-47bf4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?