Next.js Discord

Discord Forum

Server Component makes unnecessary calls to api due to router.push .

Unanswered
American black bear posted this in #help-forum
Open in Discord
American black bearOP
Search bar uses a debounce value that triggers a router.push that updates the search params .

RecommendRecipes ( the server component ) is triggered due to the router.push and makes a lot of calls to the api .

On npm run dev , it also triggers the unnecessaryly when search bar is active .

Is there a way to make the server component only get rendered once ?

Is there also a replacement for router.push that can be seen by search params and doesnt rerender server components

0 Replies