mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
The issues with the current export statement validation for app router pages are documented in the added fixtures, see also the inline comments in the diff.
31 lines
565 B
JavaScript
31 lines
565 B
JavaScript
// Rules here:
|
|
// 1. Each exported function should still be exported, but as a reference `registerServerReference(...)`.
|
|
// 2. Actual action functions should be renamed to `$$ACTION_...` and got exported.
|
|
|
|
async function foo() {
|
|
'use server'
|
|
console.log(1)
|
|
}
|
|
|
|
export { foo }
|
|
|
|
export async function bar() {
|
|
'use server'
|
|
console.log(2)
|
|
}
|
|
|
|
export default async function baz() {
|
|
'use server'
|
|
console.log(3)
|
|
}
|
|
|
|
export const qux = async () => {
|
|
'use server'
|
|
console.log(4)
|
|
}
|
|
|
|
export const quux = async function quuux() {
|
|
'use server'
|
|
console.log(5)
|
|
}
|