TanStack / query

🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.
https://tanstack.com/query
MIT License
42.76k stars 2.92k forks source link

feat(react-query): export QueryErrorResetBoundaryFunction #8089

Closed DogPawHat closed 1 month ago

DogPawHat commented 2 months ago

Export the QueryErrorResetBoundaryFunction render prop function signature so users don't have to write wierd types of there own

In response to an issue I saw on Theo's discord where someone had this ugly code:

type ResetFunction = Parameters<Exclude<QueryErrorResetBoundaryProps["children"], React.ReactNode>>[0]["reset"];

So now that could just be replaced with

import { QueryErrorResetBoundary, type QueryErrorResetFunction } from '@tanstack/react-query'
nx-cloud[bot] commented 2 months ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit baf88fd085037e10683d957b06d18322bcb9f793. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets - [`nx affected --targets=test:sherif,test:knip,test:eslint,test:lib,test:types,test:build,build --parallel=3`](https://cloud.nx.app/runs/Bjm4atafKN?utm_source=pull-request&utm_medium=comment) - [`nx run-many --target=build --exclude=examples/** --exclude=integrations/**`](https://cloud.nx.app/runs/bJ1DNmmcS3?utm_source=pull-request&utm_medium=comment)

Sent with 💌 from NxCloud.

pkg-pr-new[bot] commented 2 months ago

Open in Stackblitz

More templates

- [@tanstack/query-example-angular-basic](https://pkg.pr.new/template/af60718e-018a-4273-8c61-18c88ec8d9c6) - [@tanstack/query-example-angular-infinite-query-with-max-pages](https://pkg.pr.new/template/7aebb981-a3c9-4b55-ba5f-2b89154ec577) - [@tanstack/query-example-angular-pagination](https://pkg.pr.new/template/dde9018d-1f97-42d9-9e0c-16269c151fc3) - [@tanstack/query-example-angular-router](https://pkg.pr.new/template/cb5de545-37b6-445d-b18e-b1017caa1b11) - [@tanstack/query-example-angular-rxjs](https://pkg.pr.new/template/0c34ccfb-af6e-455e-846d-6a6566c4cedf) - [@tanstack/query-example-angular-simple](https://pkg.pr.new/template/15851270-61e3-4c79-96c7-35b101735aac) - [@tanstack/query-example-solid-astro](https://pkg.pr.new/template/f856e9eb-f11b-4801-bf2b-2eadb2683d42) - [@tanstack/query-example-solid-basic](https://pkg.pr.new/template/39fd55fe-8cd2-4c14-9f5f-6c18e6835a6a) - [@tanstack/query-example-solid-basic-graphql-request](https://pkg.pr.new/template/c4f61201-c63d-40bd-9ec7-9256263942f8) - [@tanstack/query-example-solid-default-query-function](https://pkg.pr.new/template/d06a5373-adc0-4d61-ad22-d4b8d1be65cd) - [@tanstack/query-example-solid-simple](https://pkg.pr.new/template/f7c57c2e-4f7d-49ae-9a59-c147e42679d5) - [@tanstack/query-example-solid-start-streaming](https://pkg.pr.new/template/b5c92ef8-0015-4c1b-b0b6-c48a5802234f) - [@tanstack/query-example-svelte-auto-refetching](https://pkg.pr.new/template/0ebbbf36-6928-4930-947c-ea66dd0cbc54) - [@tanstack/query-example-svelte-basic](https://pkg.pr.new/template/2aa33e05-3e32-4d3b-afab-74aedf31ad5d) - [@tanstack/query-example-svelte-load-more-infinite-scroll](https://pkg.pr.new/template/ef994687-508d-4535-bf3a-b55feff4be68) - [@tanstack/query-example-svelte-optimistic-updates](https://pkg.pr.new/template/e609dc38-81ab-40ed-8e58-eb4f8e9d7dcc) - [@tanstack/query-example-svelte-playground](https://pkg.pr.new/template/8e569df2-c53c-43e1-8f3b-f2cd4174f140) - [@tanstack/query-example-svelte-simple](https://pkg.pr.new/template/af60a51f-e170-46b2-bb37-055a6cd1d30d) - [@tanstack/query-example-svelte-ssr](https://pkg.pr.new/template/89a905f5-58ed-46fc-967b-e626fc0b4823) - [@tanstack/query-example-svelte-star-wars](https://pkg.pr.new/template/bab6d46c-eef3-4c83-9eb8-ccf4787cd742) - [@tanstack/query-example-react-algolia](https://pkg.pr.new/template/23a8c74b-b84b-4762-9129-49669810c5b5) - [@tanstack/query-example-react-auto-refetching](https://pkg.pr.new/template/05c4da3d-f3f6-41d4-81fb-beaf36d86b08) - [@tanstack/query-example-react-basic](https://pkg.pr.new/template/45fed3f6-9123-4ca3-9707-65f5cf177a0c) - [@tanstack/query-example-react-basic-graphql-request](https://pkg.pr.new/template/8d1d73c4-2cd4-4d84-b945-5460b82c7a33) - [@tanstack/query-example-react-default-query-function](https://pkg.pr.new/template/da43b0ed-0e32-4f25-b3db-742ce42e8629) - [@tanstack/query-example-react-devtools-panel](https://pkg.pr.new/template/ccb46120-608a-44b4-9da0-b5f6c911249b) - [@tanstack/query-example-react-infinite-query-with-max-pages](https://pkg.pr.new/template/9f468f71-ed43-4f88-983c-87905bb6c23c) - [@tanstack/query-example-react-load-more-infinite-scroll](https://pkg.pr.new/template/c0fbcf29-ff51-4b3f-93c0-9c56791f7478) - [@tanstack/query-example-react-nextjs](https://pkg.pr.new/template/cb47a978-5f96-41ab-b0cd-631de4ce314a) - [@tanstack/query-example-react-nextjs-app-prefetching](https://pkg.pr.new/template/315f8e49-5830-4008-b7fd-8f33273f84b8) - [@tanstack/query-example-nextjs-suspense-streaming](https://pkg.pr.new/template/f8003338-6531-46dc-91b2-0d4d686251a7) - [@tanstack/query-example-react-offline](https://pkg.pr.new/template/27bf6fa4-da80-46d7-b339-471c081112f4) - [@tanstack/query-example-react-optimistic-updates-cache](https://pkg.pr.new/template/79edb088-1033-4384-97ad-ee0603fe874b) - [@tanstack/query-example-react-optimistic-updates-ui](https://pkg.pr.new/template/35977e81-ef12-4938-904b-64b28ea345ea) - [@tanstack/query-example-react-pagination](https://pkg.pr.new/template/08c6923b-fe4b-46ff-9352-e3dbec22b332) - [@tanstack/query-example-react-playground](https://pkg.pr.new/template/aa0ea6a0-ad55-41e6-8d7f-aab5596f7286) - [@tanstack/query-example-react-prefetching](https://pkg.pr.new/template/ab838b20-6f84-48d5-ba98-3bac9320c5f7) - [@tanstack/query-example-react-react-native](https://pkg.pr.new/template/ad00c59d-1506-4d05-975e-28d084a6e445) - [@tanstack/query-example-react-router](https://pkg.pr.new/template/86be40a5-173c-4014-bb3a-f3dc2dbc9444) - [@tanstack/query-example-react-rick-morty](https://pkg.pr.new/template/42f891dc-c9f9-4a17-b561-8aa19e8b868e) - [@tanstack/query-example-react-shadow-dom](https://pkg.pr.new/template/46d692f6-ad05-4931-8168-f5b9f6d86eeb) - [@tanstack/query-example-react-simple](https://pkg.pr.new/template/9e5849e4-8beb-48d2-8e8c-267838b0d23a) - [@tanstack/query-example-react-star-wars](https://pkg.pr.new/template/a4088d91-7324-411f-85b4-31b9caf21b84) - [@tanstack/query-example-react-suspense](https://pkg.pr.new/template/d983ba1b-94cf-42bd-9841-5b7adf23b029) - [@tanstack/query-example-vue-2.6-basic](https://pkg.pr.new/template/dfae34aa-feac-43ba-9a38-a96d879c17da) - [@tanstack/query-example-vue-2.7-basic](https://pkg.pr.new/template/5e945eda-16ed-4ea2-a7a2-3141bbb5f244) - [@tanstack/query-example-vue-basic](https://pkg.pr.new/template/6b6fa9f4-75f9-425e-826e-d78a8e691771) - [@tanstack/query-example-vue-dependent-queries](https://pkg.pr.new/template/49a67aa7-58de-4ea9-9e17-7c631c469314) - [@tanstack/query-example-vue-nuxt3](https://pkg.pr.new/template/dacb4d03-059d-4c5a-84b8-ad9d31e49a41) - [@tanstack/query-example-vue-persister](https://pkg.pr.new/template/d57c70a4-c68e-4cfc-a01d-c5c14583df50) - [@tanstack/query-example-vue-simple](https://pkg.pr.new/template/09e5a2f0-74be-4dd0-a007-9bdfb3070255)

@tanstack/angular-query-devtools-experimental

``` pnpm add https://pkg.pr.new/@tanstack/angular-query-devtools-experimental@8089 ```

@tanstack/angular-query-experimental

``` pnpm add https://pkg.pr.new/@tanstack/angular-query-experimental@8089 ```

@tanstack/eslint-plugin-query

``` pnpm add https://pkg.pr.new/@tanstack/eslint-plugin-query@8089 ```

@tanstack/query-broadcast-client-experimental

``` pnpm add https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@8089 ```

@tanstack/query-async-storage-persister

``` pnpm add https://pkg.pr.new/@tanstack/query-async-storage-persister@8089 ```

@tanstack/query-core

``` pnpm add https://pkg.pr.new/@tanstack/query-core@8089 ```

@tanstack/query-devtools

``` pnpm add https://pkg.pr.new/@tanstack/query-devtools@8089 ```

@tanstack/query-sync-storage-persister

``` pnpm add https://pkg.pr.new/@tanstack/query-sync-storage-persister@8089 ```

@tanstack/query-persist-client-core

``` pnpm add https://pkg.pr.new/@tanstack/query-persist-client-core@8089 ```

@tanstack/react-query

``` pnpm add https://pkg.pr.new/@tanstack/react-query@8089 ```

@tanstack/react-query-devtools

``` pnpm add https://pkg.pr.new/@tanstack/react-query-devtools@8089 ```

@tanstack/react-query-next-experimental

``` pnpm add https://pkg.pr.new/@tanstack/react-query-next-experimental@8089 ```

@tanstack/react-query-persist-client

``` pnpm add https://pkg.pr.new/@tanstack/react-query-persist-client@8089 ```

@tanstack/solid-query

``` pnpm add https://pkg.pr.new/@tanstack/solid-query@8089 ```

@tanstack/solid-query-devtools

``` pnpm add https://pkg.pr.new/@tanstack/solid-query-devtools@8089 ```

@tanstack/solid-query-persist-client

``` pnpm add https://pkg.pr.new/@tanstack/solid-query-persist-client@8089 ```

@tanstack/svelte-query

``` pnpm add https://pkg.pr.new/@tanstack/svelte-query@8089 ```

@tanstack/svelte-query-devtools

``` pnpm add https://pkg.pr.new/@tanstack/svelte-query-devtools@8089 ```

@tanstack/svelte-query-persist-client

``` pnpm add https://pkg.pr.new/@tanstack/svelte-query-persist-client@8089 ```

@tanstack/vue-query

``` pnpm add https://pkg.pr.new/@tanstack/vue-query@8089 ```

@tanstack/vue-query-devtools

``` pnpm add https://pkg.pr.new/@tanstack/vue-query-devtools@8089 ```

commit: baf88fd

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 81.84%. Comparing base (2fe16e5) to head (baf88fd). Report is 28 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/TanStack/query/pull/8089/graphs/tree.svg?width=650&height=150&src=pr&token=jqEbswkEDQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack)](https://app.codecov.io/gh/TanStack/query/pull/8089?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) ```diff @@ Coverage Diff @@ ## main #8089 +/- ## =========================================== + Coverage 45.41% 81.84% +36.43% =========================================== Files 200 26 -174 Lines 7456 358 -7098 Branches 1696 98 -1598 =========================================== - Hits 3386 293 -3093 + Misses 3694 56 -3638 + Partials 376 9 -367 ``` | [Components](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | Coverage Δ | | |---|---|---| | [@tanstack/angular-query-devtools-experimental](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/angular-query-experimental](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/eslint-plugin-query](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/query-async-storage-persister](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/query-broadcast-client-experimental](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/query-codemods](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/query-core](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/query-devtools](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/query-persist-client-core](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/query-sync-storage-persister](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/react-query](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `93.10% <100.00%> (-0.03%)` | :arrow_down: | | [@tanstack/react-query-devtools](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `10.00% <ø> (ø)` | | | [@tanstack/react-query-next-experimental](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/react-query-persist-client](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `100.00% <ø> (ø)` | | | [@tanstack/solid-query](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/solid-query-devtools](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/solid-query-persist-client](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/svelte-query](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/svelte-query-devtools](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/svelte-query-persist-client](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/vue-query](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | | | [@tanstack/vue-query-devtools](https://app.codecov.io/gh/TanStack/query/pull/8089/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TanStack) | `∅ <ø> (∅)` | |