I've put together a Client and a Server component (based on App Router
), and managed to refresh Server on user input (specifically when the user types anything), basically forcing a refresh of the route.-
router.push(pathname)
So far so good, but I actually need to pass user input from Client to Server in order to filter fetch based on it (i.e a date range).
I'm guessing I could use dynamic routes, but semantically doesn't feel right (it's not like I'm navigating to an entity detail). Also, server actions kind of looks what I need, but since it's an experimental feature, I was wondering if there's already a different approach available; Server fetch based on user input seems like a basic feature to me, but still can't find a straight "official" pattern to get it working.
Any alternatives / suggestions?
EDIT As @ivanatias suggested, this thread shows how to pass params through query strings, while this could potentially work, unfortunately since the url is changing, the state of the input fields is lost.