2018-07-05 14:41:18 +02:00
|
|
|
import * as React from 'react'
|
|
|
|
import { withRouter } from 'next/router'
|
|
|
|
|
|
|
|
class PageA extends React.Component {
|
2019-11-11 04:24:53 +01:00
|
|
|
goToB() {
|
2018-07-05 14:41:18 +02:00
|
|
|
this.props.router.push('/b')
|
|
|
|
}
|
|
|
|
|
2019-11-11 04:24:53 +01:00
|
|
|
render() {
|
2018-07-05 14:41:18 +02:00
|
|
|
return (
|
2019-11-11 04:24:53 +01:00
|
|
|
<div id="page-a">
|
2018-07-05 14:41:18 +02:00
|
|
|
<button onClick={() => this.goToB()}>Go to B</button>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default withRouter(PageA)
|