Lazy Loading
Calling useRemoteData does not fetch data. It just creates a store.
The request only fires when that store is rendered with <Await>. This is a deliberate design choice:
you can create many stores high up in your component tree and pass them down as props.
Only the stores that are actually rendered will trigger a network request.
This means:
- No wasted requests. A store behind a collapsed panel or an unselected tab stays idle.
- No
enabledflag. You don't need to conditionally disable fetching — if the component isn't rendered, the fetch doesn't happen. - Declare everything upfront, fetch on demand. Define your data dependencies at the top of your component tree, and let the rendering tree decide what's needed.