Sean Aguinaga
Sean Aguinaga2w ago

Can I fetch then render/navigate?

iOS uses this pattern a lot I click an item, it shows a spinner in the item, then I can navigate once it’s been loaded (see video) If I fetch data one off with convex.query, will useQuery have that data preloaded on the next page upon navigating to it?
6 Replies
Sean Aguinaga
Sean AguinagaOP2w ago
erquhart
erquhart2w ago
GitHub
convex-helpers/packages/convex-helpers/README.md at main · get-con...
A collection of useful code to complement the official packages. - get-convex/convex-helpers
Sean Aguinaga
Sean AguinagaOP6d ago
Would I need to wrap something in a useEffect and then navigate once I got a result?
erquhart
erquhart5d ago
I haven't tried, but that sounds like a fringe scenario where you may or may not get a sub-second lead on the query resolving. Recommend just trying it and seeing if it meaningfully improves your experience.
Sean Aguinaga
Sean AguinagaOP5d ago
Sometimes on nav there is an animation/push to the next page and it can be funky if there is any ui change on that page as it slides over from loading to resolved for example As opposed to waiting for the page to be ready and then animating it over'
erquhart
erquhart9h ago
gotcha - the helper I linked should resolve that

Did you find this page helpful?