File size: 410 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'use client'

import { useState } from 'react'
import { inc } from '../../client/actions'

export function Button() {
  const [count, setCount] = useState(0)

  return (
    <>
      <p id="count">{count}</p>
      <button
        id="inc"
        onClick={async () => {
          const newCount = await inc(count)
          setCount(newCount)
        }}
      >
        click me
      </button>
    </>
  )
}