TanStackT
TanStack3y ago
2 replies
primary-violet

How to reset data on component remount

When component mounts first time its data is undefined, then after fetch is completed it is lets say "data1". After component is remounted, I want data field to be again undefined but getting "data1"(from previous fetch) until new fetch is completed and it is "data2". How can I reset data?
P.S. cache and stale time is already 0
Was this page helpful?