Questions tagged [tanstack]
74 questions
0
votes
2 answers
Fetch on mount and disable query in React-query
There is a search result page where query params are passed to useQuery. On this page, we can change our search prompt (query param essentially) however I only want to refetch when user click "Search" button.
I've tried setting enabled:false and…

PCPbiscuit
- 417
- 5
- 16
0
votes
0 answers
Tanstack DataTable globalFilter with relational prisma model as table columns
So basically I have a DataTable where I want to use globalFilter, to filter all my columns. I've properly defined my columns in the columns.tsx, but two of these columns is actually an array of string, in which these two columns will fetch from my…

moe
- 1
- 4
0
votes
0 answers
Tanstack Query - Update dependant query from an other component
I have two remote components in my application.
I would like to create a query that is deactivated by default and used by one component.
I would like my second component to activate the previous query.
The only way I've found is to use a store to…

FeckNeck
- 114
- 9
0
votes
0 answers
How do I know which columns have been unpinned in Material-React-Table (TanStack Table)?
I am currently working with the Material-React-Table (which itself uses the TanStack library), which has been great at offering flexibility and customisation, however I am struggling with the "column pinning" part.
I overwrite the table's state, so…

Typo
- 21
- 4
0
votes
1 answer
Tanstack Query - Check when data are changing inside a mutation
I have a mutation and I would like to know if there is a way to know that the data of installedBuckets are changing ?
Like for example isLoading or something like that ?
mutation :
const useUninstallBucket = () => {
const queryClient =…

FeckNeck
- 114
- 9
0
votes
0 answers
TanStack Table Update State
I am using TanStack Table to display some data. I am trying to filter categories which are saved in an array. Seems that I can filter the data with a custom filter, but I cannot figure out how to update the state of the table rows to the filtered…

OWolf
- 5,012
- 15
- 58
- 93
0
votes
0 answers
@tanstack/react-table library Cannot read properties of null reading useState
Blockquote
I used vite to boostrap my react app with ("@tanstack/react-table": "^8.9.2") for my table. Locally everything works fine but can't say thesame for production as it throws a blank screen.
The following error occurs in…

JUSTICE AJAH
- 1
- 1
0
votes
1 answer
shadcn/ui data-table date-range filter
Is there someone using shadcn/ui data-table here? I am looking for samples to filter my data using shadcn/ui Date Range Picker to filter the current table.
Here is my Date Range Picker component:
…

Daryll santos
- 1
- 3
0
votes
1 answer
React-Table custom sorting fn
Does anyone know how to write a custom sorting fn using Tanstack's React-table? I've been trying to sort a column based on priority (high, medium, low) but the docs are a little confusing as to how to implement.
So far I've declared the module like…

Mathew
- 318
- 11
0
votes
0 answers
How can I pass the data of my customized editable React Table v7 using Axios?
I am making a table where it allows users to edit the data in the react table. I used React Table v7 of Tanstack. So far, I have made it to the point of my use cases except sending/post/pass/submit the data edited by the user to my database API…

Rax22
- 23
- 7
0
votes
1 answer
Why is my React query in Next.js with tanstack/react-query still making API requests before the staleTime is up?
Im testing react-query and SSR from nextjs to prefetch data only when the staleTime is gone. But after testing it, every 20 seconds a new get request is done to the API, even if the the staleTime is more than 20 seconds. I don't really understand…
0
votes
0 answers
Is there any option for sticky columns in @tanstack/react-table. I am migrating from React-table v6 to v8
I am migrating from React table V6 to @tanstack/react-table V8. I am able to migrate the basic functionality like sorting, filtering and column resizing etc.
Previously I was using…

ghostman231111
- 3
- 6
0
votes
1 answer
How can a different set of columns be defined for grouping rows in TanStack Table (previously react-table)?
Given a table of budget line items, I would like to group them by year where each year grouping should display the year and the aggregate amount of the line items as in this screenshot:
example datatable with custom grouping rows
Is it possible to…

zkdiff
- 3
- 1
0
votes
0 answers
Mocking Data Object With Vitest For A Vue Component Using @tanstack/vue-query
I have a simple Vue component constructed around a hook. This component renders when there's data. I know that it is recommended to only test hooks if they are used in many components. I am confused how to properly mock that response within a…

Kyle
- 180
- 2
- 11
0
votes
1 answer
How to merge row cells in TanStack React Table v7 to v8
I'm a newbie developer and I rely a lot on resources available on the web. I am developing this kind of table where it needed to be merged but I am using the react table TanStack latest version.
This is the table I want to create but based on…

Rax22
- 23
- 7