
discord-questions.trpc.io/m/1030047679977357312
Preview meta tags from the discord-questions.trpc.io website.
Linked Hostnames
7- 6 links todiscord-questions.trpc.io
- 1 link todiscord.com
- 1 link todiscord.gg
- 1 link togithub.com
- 1 link totkdodo.eu
- 1 link towww.answeroverflow.com
- 1 link towww.typescriptlang.org
Thumbnail
Search Engine Appearance
data becomes never[] when destructuring with a fallback value - tRPC
Currently it doesn't seem possible to set a fallback value on a destructured `data` property, for example: ```ts const { data = [] } = trpc.useQuery(['company.listIds']); // expecting data to be the inferred type { id: string }[] but instead it's never[] // This somehow works const query = trpc.useQuery(['company.listIds']); const { data = [] } = query; // data is correctly typed as { id: string }[] ``` The "equivalent" with pure react-query: ```ts interface Company { id: string; } const { data = [] } = useQuery<Company[]>(['company.listIds'], someFetchFunction); // data is correctly typed as Company[] ``` Does anyone know if there's a way to achieve the same behaviour of `react-query` in `@trpc/react`?
Bing
data becomes never[] when destructuring with a fallback value - tRPC
Currently it doesn't seem possible to set a fallback value on a destructured `data` property, for example: ```ts const { data = [] } = trpc.useQuery(['company.listIds']); // expecting data to be the inferred type { id: string }[] but instead it's never[] // This somehow works const query = trpc.useQuery(['company.listIds']); const { data = [] } = query; // data is correctly typed as { id: string }[] ``` The "equivalent" with pure react-query: ```ts interface Company { id: string; } const { data = [] } = useQuery<Company[]>(['company.listIds'], someFetchFunction); // data is correctly typed as Company[] ``` Does anyone know if there's a way to achieve the same behaviour of `react-query` in `@trpc/react`?
DuckDuckGo

data becomes never[] when destructuring with a fallback value - tRPC
Currently it doesn't seem possible to set a fallback value on a destructured `data` property, for example: ```ts const { data = [] } = trpc.useQuery(['company.listIds']); // expecting data to be the inferred type { id: string }[] but instead it's never[] // This somehow works const query = trpc.useQuery(['company.listIds']); const { data = [] } = query; // data is correctly typed as { id: string }[] ``` The "equivalent" with pure react-query: ```ts interface Company { id: string; } const { data = [] } = useQuery<Company[]>(['company.listIds'], someFetchFunction); // data is correctly typed as Company[] ``` Does anyone know if there's a way to achieve the same behaviour of `react-query` in `@trpc/react`?
General Meta Tags
6- titledata becomes never[] when destructuring with a fallback value - tRPC
- charsetutf-8
- viewportwidth=device-width, initial-scale=1
- next-size-adjust
- descriptionCurrently it doesn't seem possible to set a fallback value on a destructured `data` property, for example: ```ts const { data = [] } = trpc.useQuery(['company.listIds']); // expecting data to be the inferred type { id: string }[] but instead it's never[] // This somehow works const query = trpc.useQuery(['company.listIds']); const { data = [] } = query; // data is correctly typed as { id: string }[] ``` The "equivalent" with pure react-query: ```ts interface Company { id: string; } const { data = [] } = useQuery<Company[]>(['company.listIds'], someFetchFunction); // data is correctly typed as Company[] ``` Does anyone know if there's a way to achieve the same behaviour of `react-query` in `@trpc/react`?
Open Graph Meta Tags
3- og:titledata becomes never[] when destructuring with a fallback value - tRPC
- og:descriptionCurrently it doesn't seem possible to set a fallback value on a destructured `data` property, for example: ```ts const { data = [] } = trpc.useQuery(['company.listIds']); // expecting data to be the inferred type { id: string }[] but instead it's never[] // This somehow works const query = trpc.useQuery(['company.listIds']); const { data = [] } = query; // data is correctly typed as { id: string }[] ``` The "equivalent" with pure react-query: ```ts interface Company { id: string; } const { data = [] } = useQuery<Company[]>(['company.listIds'], someFetchFunction); // data is correctly typed as Company[] ``` Does anyone know if there's a way to achieve the same behaviour of `react-query` in `@trpc/react`?
- og:imagehttps://discord-questions.trpc.io/og/post?id=1030047679977357312
Twitter Meta Tags
4- twitter:cardsummary_large_image
- twitter:titledata becomes never[] when destructuring with a fallback value - tRPC
- twitter:descriptionCurrently it doesn't seem possible to set a fallback value on a destructured `data` property, for example: ```ts const { data = [] } = trpc.useQuery(['company.listIds']); // expecting data to be the inferred type { id: string }[] but instead it's never[] // This somehow works const query = trpc.useQuery(['company.listIds']); const { data = [] } = query; // data is correctly typed as { id: string }[] ``` The "equivalent" with pure react-query: ```ts interface Company { id: string; } const { data = [] } = useQuery<Company[]>(['company.listIds'], someFetchFunction); // data is correctly typed as Company[] ``` Does anyone know if there's a way to achieve the same behaviour of `react-query` in `@trpc/react`?
- twitter:imagehttps://discord-questions.trpc.io/og/post?id=1030047679977357312
Link Tags
12- canonicalhttps://discord-questions.trpc.io/m/1030047679977357312
- iconhttps://cdn.answeroverflow.com/867764511159091230/6af104c7f0f39a12fcd55bd7bd28928f/icon.png
- preloadhttps://www.answeroverflow.com/_next/static/media/4f05ba3a6752a328-s.p.woff2
- preloadhttps://www.answeroverflow.com/_next/static/media/9cf9c6e84ed13b5e-s.p.woff2
- preload/discord/4.png
Links
12- https://discord-questions.trpc.io
- https://discord-questions.trpc.io/search
- https://discord-questions.trpc.io/u/136072283444871168
- https://discord-questions.trpc.io/u/143810637758332928
- https://discord-questions.trpc.io/u/209642993844486144