forked from vercel/next.js
/
about.tsx
34 lines (30 loc) · 794 Bytes
/
about.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import type { MouseEvent } from 'react'
import Link from 'next/link'
import { useCount, useDispatchCount } from '../components/Counter'
const AboutPage = () => {
const count = useCount()
const dispatch = useDispatchCount()
const handleIncrease = (event: MouseEvent<HTMLButtonElement>) =>
dispatch({
type: 'INCREASE',
})
const handleIncrease15 = (event: MouseEvent<HTMLButtonElement>) =>
dispatch({
type: 'INCREASE_BY',
payload: 15,
})
return (
<>
<h1>ABOUT</h1>
<p>Counter: {count}</p>
<button onClick={handleIncrease}>Increase</button>
<button onClick={handleIncrease15}>Increase By 15</button>
<p>
<Link href="/">
<a>Home</a>
</Link>
</p>
</>
)
}
export default AboutPage