Next.js Discord

Discord Forum

Is it bad practice to use server actions for GET requests?

Unanswered
Atlantic herring posted this in #help-forum
Open in Discord
Atlantic herringOP
Hey quick question, is it bad practice to use server actions for GET requests?

8 Replies

@Atlantic herring Hey quick question, is it bad practice to use server actions for GET requests?
Whiteleg shrimp
Server actions are always post requests and they always run sequentially even when using Promise.all
So yes, it will be a bad practice
I'm hoping that some day we will get server actions for data fetching
@Whiteleg shrimp I'm hoping that some day we will get server actions for data fetching
Atlantic herringOP
What is the preferred approach for data fetching?
Whiteleg shrimp
I currently have an API built with Hono and fetched by react query
But the recommended and simpler method is using server components