Next.js Discord

Discord Forum

where do we fetch the api

Answered
Transvaal lion posted this in #help-forum
Open in Discord
Transvaal lionOP
do we fetch the api directly in the file we want to get the data or in a services folder or in an actions file ?
Answered by Asian black bear
There is no strict rules whether you fetch directly in a component or call a reusable function for that. It's up to you and your desired architecture.
View full answer

2 Replies

Asian black bear
There is no strict rules whether you fetch directly in a component or call a reusable function for that. It's up to you and your desired architecture.
Answer