"on-demand" live query returns empty data on remount.
I’m testing the new query-driven sync. First load works great, but if I navigate away and back, the query returns [] and queryFn isn’t called again.
Is this something wrong with my implementation, or a bug with on-demand + navigation?
I’m trying to emulate the blog post and have a collection like this:
In my component, I am using it like this:
@tanstack/query-db-collection: 1.0.0,
@tanstack/react-db: 0.1.44,
1 Reply
harsh-harlequinOP•2w ago
I saw in the WIP large saas example on github its done a little differently, which I have emulated to an extent, and it does work as expected there. The critical part being the "preload" in the loader.
With this liveQueryCollectionOptions pattern + preload, navigation away and back keeps working as expected.
Is the first pattern supposed to work with on-demand, or is there something I’m missing about how queryCollectionOptions handles back-nav / unsubscribe?