Unverified Commit d200e5fa authored by Shu Ding's avatar Shu Ding Committed by GitHub

Support default arrow function export in server boundary (#46977

This PR adds basic support for default export of an async arrow
function:

```js
export default async (a, b) => { console.log(a, b) }
```

In upcoming PRs I'll refactor named export handling and inlined
declarations.
parent 10f2268f
/* __next_internal_action_entry_do_not_use__ */ export default (()=>{});
x Only async functions are allowed to be exported in a "use server" file.
,-[input.js:2:1]
2 |
3 | export default () => {}
: ^^^^^^^^^^^^^^^^^^^^^^^
`----
'use server'
export default async (a, b) => { console.log(a, b) }
/* __next_internal_action_entry_do_not_use__ default */ export default $ACTION_default_0 = async (a, b)=>{
console.log(a, b);
};
$ACTION_default_0.$$typeof = Symbol.for("react.server.reference");
$ACTION_default_0.$$id = "c18c215a6b7cdc64bf709f3a714ffdef1bf9651d";
$ACTION_default_0.$$bound = [];
var $ACTION_default_0;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment