Next.js Discord

Discord Forum

Can I put data fetching functions and server action functions in the same file?

Unanswered
Fieldfare posted this in #help-forum
Open in Discord
FieldfareOP
It seems like server action functions require the 'use server' directive. I don't think data fetching functions do --- I would normally just use them directly in a server component without this directive. Is it an issue if I put them in the same file?

0 Replies