mirror of
https://github.com/TanStack/query.git
synced 2026-11-16 22:50:20 +00:00
The type narrowing example wraps useQuery() in reactive() without saying why, so destructuring the result directly and then checking isSuccess looks like it should work (#9244). Spell out that reactive() is what flattens the refs into one discriminated union, and show the data.value !== undefined check as the alternative when reactive() is not an option. Pin both shapes with type tests: the non-reactive result exposes Ref<T> | Ref<undefined>, and narrowing on data.value refines the ref itself. Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc> |
History
|
|
|---|---|---|
| .. | ||
| angular | ||
| lit | ||
| preact | ||
| react | ||
| solid | ||
| svelte | ||
| vue | ||