Next.js Discord

Discord Forum

Data fetching best practices

Answered
Himalayan posted this in #help-forum
Open in Discord
HimalayanOP
I am currently building a form that uses user inputs to fetch & filter data based on those inputs, using a server actions seems a bit weird (using a POST method for what is essentially a GET method) and from what i've been reading in docs and seen in videos, using the api route handlers isn't the best practice, so I am a bit confused as to what is considered the best practice to fetch data with user inputs and a submit button
Answered by joulev
A good practice is by search params. Something like /search?q=hello+world. You can then get the data in the page server component
View full answer

4 Replies