Hi all,
I’ve got an application with a reporting module where the user can choose from some report params and then view a table (built with Tanstack Table) with the first 50 records..
I’m needing to add an “Export all” button that should page through all the data and write it out to an excel file. I’ve gone through multiple implementations of this, but so far I’ve only been able to make this work by writing the paginated query twice– once to power the table and one to fetch the data for the download (using tRPC’s useContext() hook). One reason I went this direction is because when performing the download, I don’t want the fetched data to cause a re-render of the table.
Obviously, this is not ideal and I’d prefer to reuse the same query (without the need to invoke useContext()). Has anyone solved a similar problem? I’d really like some advice on this.