Open eps1lon opened 2 days ago
Commit: a4c79d5162c4a31809db2f6f8080fca3d6788fd7
Commit: a4c79d5162c4a31809db2f6f8080fca3d6788fd7
__NEXT_EXPERIMENTAL_PPR=true pnpm test-dev test/e2e/app-dir/actions/app-action.test.ts
(PPR)
Read more about building and testing Next.js in contributing.md.
Our TypeScript plugin checks if props passed to Client Components can be serialized. Functions can generally not be serialized. However, Server functions can be serialized. Server functions are not different to normal functions structurally to TypeScript. We'd have to teach TypeScript to understand directives (
use server
specifically).Instead, we leverage the convention to suffix action props with
Action
(or naming themaction
). This is motivated by the existingaction
andformAction
props inreact-dom
. We'll also establish this pattern on react.dev.Closes https://github.com/vercel/next.js/issues/54156
Test plan
Action
suffix are fine: