File size: 793 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import Counter from './counter'
import Form from './form'
import ClientForm from './client-form'

import dec, { slowInc } from './actions'
import { log } from './actions-2'
import { inc } from './actions-3'

export default function Page() {
  const two = { value: 2 }

  // https://github.com/vercel/next.js/issues/58463
  const data = '你好'

  return (
    <>
      <Counter
        inc={inc}
        dec={dec}
        slowInc={slowInc}
        double={async (x) => {
          'use server'
          if (data === '你好') {
            return x * two.value
          }
          // Wrong answer
          return 42
        }}
      />
      <Form />
      <ClientForm />
      <form>
        <button id="log" formAction={log}>
          log
        </button>
      </form>
    </>
  )
}