|
I have a tanstack re-usable table and I am in a situation where url parameters are no longer fixed like only for pagination or sorting. Some pages might have status= or type= but others not. What I want is I will pass url parameters like this -> url?status=published&date=2024-08-13 to the tanstack table and nuqs should be able to append/merge/update these parameters. And shallow: false by default so any changes to any parameter should re-render server component. This would make my table truly re-usable. Is this possible? Please, help. Thank you. |
Replies: 1 comment 3 replies
|
You can define search params completely independently from one another, so your table component only deals with table-related matters (sorting, pagination), and another component deals with domain-specific controls (eg: data fetching). The URL is merged/resolved on update. Each hook can define different options. In the case of |
You can define search params completely independently from one another, so your table component only deals with table-related matters (sorting, pagination), and another component deals with domain-specific controls (eg: data fetching). The URL is merged/resolved on update.
Each hook can define different options. In the case of
shallow, if you were to update one search param withshallow: trueand one withshallow: falsein the same event loop tick, theshallow: falsewould take precedence and notify the server.