Next.js Discord

Discord Forum

What is better ? Dynamic routes parameters or search parameters

Answered
Sun bear posted this in #help-forum
Open in Discord
Sun bearOP
Hello ! Does anyone know what's the better one for creating a simple filter ? Like calendar/fullWeek or calendar?&fullweek=true.
Thank you !
Answered by B33fb0n3
For a filter I would use searchparams, because you can directly get the specific filters. Also you don’t need to define any single filter in your routes or even catch all routes. So I would use searchparams 🙂
View full answer

3 Replies

@Sun bear Hello ! Does anyone know what's the better one for creating a simple filter ? Like calendar/fullWeek or calendar?&fullweek=true. Thank you !
For a filter I would use searchparams, because you can directly get the specific filters. Also you don’t need to define any single filter in your routes or even catch all routes. So I would use searchparams 🙂
Answer
Sun bearOP
alright thank you for your input !