2017-05-09 21:03:20 +00:00
|
|
|
import React from 'react'
|
|
|
|
import Link from 'next/link'
|
|
|
|
|
2017-05-11 15:52:28 +00:00
|
|
|
let counter = 0
|
2017-05-09 21:03:20 +00:00
|
|
|
|
2017-05-11 15:52:28 +00:00
|
|
|
export default class Counter extends React.Component {
|
2017-05-09 21:03:20 +00:00
|
|
|
increaseCounter () {
|
2017-05-11 15:52:28 +00:00
|
|
|
counter++
|
|
|
|
this.forceUpdate()
|
2017-05-09 21:03:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
render () {
|
|
|
|
return (
|
|
|
|
<div id='counter-page'>
|
|
|
|
<div>
|
|
|
|
<Link href='/'>
|
2017-05-11 15:52:28 +00:00
|
|
|
<a id='go-back'>Go Back</a>
|
2017-05-09 21:03:20 +00:00
|
|
|
</Link>
|
|
|
|
</div>
|
2017-05-11 15:52:28 +00:00
|
|
|
<p>Counter: {counter}</p>
|
2017-05-09 21:03:20 +00:00
|
|
|
<button
|
2017-05-10 01:54:08 +00:00
|
|
|
id='counter-increase'
|
2017-05-09 21:03:20 +00:00
|
|
|
onClick={() => this.increaseCounter()}
|
|
|
|
>
|
|
|
|
Increase
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|