You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my React Native app, the Portfolio screen displays a list of investment cards. Tapping on any card navigates to the InvestmentDetails screen, where a user can sell the investment using the useRequestInvestmentSell hook.
✅ Expected Behavior:
After submitting a sell request:
1- InvestmentDetails screen updates:
Shows a flag
Reflects the updated list of sell requests
2- Portfolio screen updates:
The sold investment card displays a flag indicating a pending sell request
To achieve this, I'm invalidating the following queries after submission:
INVESTMENT_SELL_REQUESTS (for the request list)
CUSTOMER_BANK_INVESTMENTS_DETAILS
CUSTOMER_BANK_INVESTMENTS (cards rendered in the Portfolio)
❌ Actual Behavior:
When navigating back to the Portfolio screen, the data does not update as expected.
The only workaround that currently works is manually calling invalidateQueries(CUSTOMER_BANK_INVESTMENTS) inside a useFocusEffect() hook on the Portfolio screen — but this feels like a hack and is not ideal for performance or code cleanliness. 😞
Thank you for filing this issue, but we need more information before looking into this.
Specifically, a minimal, standalone, runnable reproduction is needed - preferably with codesandbox or stackblitz. If your issue is TypeScript related, prefer a TypeScript playground.
We'll close this issue for now, but we'll certainly re-open it if there is a proper reproduction.
Describe the bug
In my React Native app, the Portfolio screen displays a list of investment cards. Tapping on any card navigates to the InvestmentDetails screen, where a user can sell the investment using the useRequestInvestmentSell hook.
✅ Expected Behavior:
After submitting a sell request:
1- InvestmentDetails screen updates:
Shows a flag
Reflects the updated list of sell requests
2- Portfolio screen updates:
To achieve this, I'm invalidating the following queries after submission:
INVESTMENT_SELL_REQUESTS (for the request list)
CUSTOMER_BANK_INVESTMENTS_DETAILS
CUSTOMER_BANK_INVESTMENTS (cards rendered in the Portfolio)
❌ Actual Behavior:
When navigating back to the Portfolio screen, the data does not update as expected.
The only workaround that currently works is manually calling invalidateQueries(CUSTOMER_BANK_INVESTMENTS) inside a useFocusEffect() hook on the Portfolio screen — but this feels like a hack and is not ideal for performance or code cleanliness. 😞
Your minimal, reproducible example
Steps to reproduce
Expected behavior
How often does this bug happen?
None
Screenshots or Videos
No response
Platform
Tanstack Query adapter
None
TanStack Query version
TypeScript version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: