Next.js Discord

Discord Forum

Can we write such code in next?

Answered
New Zealand posted this in #help-forum
Open in Discord
Avatar
New ZealandOP
/component/actions.ts
'use server'
function foo {...}


/app/api/some-get.ts
function GET()  {
    ...
    foo()
    ...
}
Answered by B33fb0n3
yes, the server action then would be translated to a normal function
View full answer

2 Replies

Avatar
yes, the server action then would be translated to a normal function
Answer
Avatar