mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
28 lines
528 B
JavaScript
28 lines
528 B
JavaScript
import React from 'react'
|
|
import Link from 'next/link'
|
|
|
|
let counter = 0
|
|
|
|
export default class Counter extends React.Component {
|
|
increaseCounter() {
|
|
counter++
|
|
this.forceUpdate()
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<div id="counter-page">
|
|
<div>
|
|
<Link href="/" id="go-back">
|
|
Go Back
|
|
</Link>
|
|
</div>
|
|
<p>Counter: {counter}</p>
|
|
<button id="counter-increase" onClick={() => this.increaseCounter()}>
|
|
Increase
|
|
</button>
|
|
</div>
|
|
)
|
|
}
|
|
}
|