mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
30bb252434
Currently an "action module" (files with `"use server"` on top) can be imported by both the server and client layers. In that case, we can't fork that action module into two modules (one on the server layer, one on the action layer), but only create it once on the server layer. This ensures that the action module instance doesn't get forked. Closes #50801. fix NEXT-1265
16 lines
273 B
JavaScript
16 lines
273 B
JavaScript
import { inc, get } from './action'
|
|
|
|
export async function Server() {
|
|
const x = await get()
|
|
return (
|
|
<>
|
|
<h2 id="value">Value = {x}</h2>
|
|
<form>
|
|
<button id="server-inc" formAction={inc}>
|
|
Inc
|
|
</button>
|
|
</form>
|
|
</>
|
|
)
|
|
}
|