2017-02-15 19:27:41 +01:00
|
|
|
import { Component } from 'react'
|
|
|
|
import Link from 'next/link'
|
|
|
|
|
|
|
|
let count = 0
|
|
|
|
|
|
|
|
export default class SelfReload extends Component {
|
2019-11-11 04:24:53 +01:00
|
|
|
static getInitialProps({ res }) {
|
2017-02-15 19:27:41 +01:00
|
|
|
if (res) return { count: 0 }
|
|
|
|
count += 1
|
|
|
|
|
|
|
|
return { count }
|
|
|
|
}
|
|
|
|
|
2019-11-11 04:24:53 +01:00
|
|
|
render() {
|
2017-02-15 19:27:41 +01:00
|
|
|
return (
|
2019-11-11 04:24:53 +01:00
|
|
|
<div id="self-reload-page">
|
|
|
|
<Link href="/nav/self-reload">
|
|
|
|
<a id="self-reload-link">Self Reload</a>
|
2017-02-15 19:27:41 +01:00
|
|
|
</Link>
|
|
|
|
<p>COUNT: {this.props.count}</p>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|