RTK-Q: Share query data between components #2057
-
Hello 👋 and thank you for this amazing library, it is really very powerful. I have a simple use case for managing the data from a // -api-slice.js
// endpoint definition
fetchTransactionsByFilters: build.query({
query: (filters) => ({
url: '/transaction',
method: 'POST',
body: filters,
}),
providesTags: ['Transactions']
}), It is a query that does a Question: How to specify in the generic component ( P.S. Don't really want to pass the Is there any pattern or suggested method how different Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You would need to keep the |
Beta Was this translation helpful? Give feedback.
You would need to keep the
args
globally somewhere and call the hook in both components with the same first argument.