Upgrade react-query
This commit is contained in:
parent
ad0046c4f4
commit
ad6e1bc099
|
@ -71,7 +71,7 @@
|
||||||
"@tailwindcss/aspect-ratio": "^0.4.2",
|
"@tailwindcss/aspect-ratio": "^0.4.2",
|
||||||
"@tailwindcss/forms": "^0.5.9",
|
"@tailwindcss/forms": "^0.5.9",
|
||||||
"@tailwindcss/typography": "^0.5.15",
|
"@tailwindcss/typography": "^0.5.15",
|
||||||
"@tanstack/react-query": "^5.0.0",
|
"@tanstack/react-query": "^5.59.13",
|
||||||
"@types/escape-html": "^1.0.1",
|
"@types/escape-html": "^1.0.1",
|
||||||
"@types/http-link-header": "^1.0.3",
|
"@types/http-link-header": "^1.0.3",
|
||||||
"@types/leaflet": "^1.8.0",
|
"@types/leaflet": "^1.8.0",
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
|
|
||||||
import { useApi } from 'soapbox/hooks';
|
import { useApi } from 'soapbox/hooks';
|
||||||
import { InstanceV1, instanceV1Schema } from 'soapbox/schemas/instance';
|
import { InstanceV1, instanceV1Schema } from 'soapbox/schemas/instance';
|
||||||
|
|
||||||
interface Opts extends Pick<UseQueryOptions<unknown>, 'enabled' | 'retryOnMount' | 'staleTime'> {
|
interface Opts {
|
||||||
/** The base URL of the instance. */
|
/** The base URL of the instance. */
|
||||||
baseUrl?: string;
|
baseUrl?: string;
|
||||||
|
enabled?: boolean;
|
||||||
|
retryOnMount?: boolean;
|
||||||
|
staleTime?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get the Instance for the current backend. */
|
/** Get the Instance for the current backend. */
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
|
|
||||||
import { useApi } from 'soapbox/hooks';
|
import { useApi } from 'soapbox/hooks';
|
||||||
import { InstanceV2, instanceV2Schema } from 'soapbox/schemas/instance';
|
import { InstanceV2, instanceV2Schema } from 'soapbox/schemas/instance';
|
||||||
|
|
||||||
interface Opts extends Pick<UseQueryOptions<unknown>, 'enabled' | 'retryOnMount' | 'staleTime'> {
|
interface Opts {
|
||||||
/** The base URL of the instance. */
|
/** The base URL of the instance. */
|
||||||
baseUrl?: string;
|
baseUrl?: string;
|
||||||
|
enabled?: boolean;
|
||||||
|
retryOnMount?: boolean;
|
||||||
|
staleTime?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get the Instance for the current backend. */
|
/** Get the Instance for the current backend. */
|
||||||
|
|
|
@ -115,7 +115,7 @@ const Announcements: React.FC = () => {
|
||||||
emptyMessage={emptyMessage}
|
emptyMessage={emptyMessage}
|
||||||
itemClassName='py-3 first:pt-0 last:pb-0'
|
itemClassName='py-3 first:pt-0 last:pb-0'
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
showLoading={isLoading && !announcements?.length}
|
showLoading={isLoading}
|
||||||
>
|
>
|
||||||
{announcements!.map((announcement) => (
|
{announcements!.map((announcement) => (
|
||||||
<Announcement key={announcement.id} announcement={announcement} />
|
<Announcement key={announcement.id} announcement={announcement} />
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import { UseQueryOptions } from '@tanstack/react-query';
|
|
||||||
import { useEffect, useMemo } from 'react';
|
import { useEffect, useMemo } from 'react';
|
||||||
|
|
||||||
import { HTTPError } from 'soapbox/api/HTTPError';
|
import { HTTPError } from 'soapbox/api/HTTPError';
|
||||||
|
@ -8,9 +7,12 @@ import { instanceV2Schema, upgradeInstance } from 'soapbox/schemas/instance';
|
||||||
|
|
||||||
import { useAppDispatch } from './useAppDispatch';
|
import { useAppDispatch } from './useAppDispatch';
|
||||||
|
|
||||||
interface Opts extends Pick<UseQueryOptions<unknown>, 'enabled' | 'retryOnMount' | 'staleTime'> {
|
interface Opts {
|
||||||
/** The base URL of the instance. */
|
/** The base URL of the instance. */
|
||||||
baseUrl?: string;
|
baseUrl?: string;
|
||||||
|
enabled?: boolean;
|
||||||
|
retryOnMount?: boolean;
|
||||||
|
staleTime?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get the Instance for the current backend. */
|
/** Get the Instance for the current backend. */
|
||||||
|
|
18
yarn.lock
18
yarn.lock
|
@ -2398,17 +2398,17 @@
|
||||||
lodash.merge "^4.6.2"
|
lodash.merge "^4.6.2"
|
||||||
postcss-selector-parser "6.0.10"
|
postcss-selector-parser "6.0.10"
|
||||||
|
|
||||||
"@tanstack/query-core@5.0.0":
|
"@tanstack/query-core@5.59.13":
|
||||||
version "5.0.0"
|
version "5.59.13"
|
||||||
resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.0.0.tgz#b37a50bb3a4f54336b6131db00b72cd29e79b480"
|
resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.59.13.tgz#8c962980af174bbd446b7e9b9999f7432897df80"
|
||||||
integrity sha512-Y1BpiA6BblJd/UlVqxEVeAG7IACn568YJuTTItAiecBI7En+33g780kg+/8lhgl+BzcUPN7o+NjBrSRGJoemyQ==
|
integrity sha512-Oou0bBu/P8+oYjXsJQ11j+gcpLAMpqW42UlokQYEz4dE7+hOtVO9rVuolJKgEccqzvyFzqX4/zZWY+R/v1wVsQ==
|
||||||
|
|
||||||
"@tanstack/react-query@^5.0.0":
|
"@tanstack/react-query@^5.59.13":
|
||||||
version "5.0.0"
|
version "5.59.13"
|
||||||
resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.0.0.tgz#707fecb71cf53ae098f682f45520d7b1640bcaa9"
|
resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.59.13.tgz#decac9c15ddc29a54dc3520a41a1dcedb1a9596a"
|
||||||
integrity sha512-diQoC8FNBcO5Uf5yuaJlXthTtbO1xM8kzOX+pSBUMT9n/cqQ/u1wJGCtukvhDWA+6j07WmIj4bfqNbd2KOB6jQ==
|
integrity sha512-GB2ELtiH8tL0rcFiM4sWvnXhazt1xRXX/LolMEV12kfEKu58aNA4lQoieslP61PO4vZO9JJMwm+6lqyS0E1HOA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@tanstack/query-core" "5.0.0"
|
"@tanstack/query-core" "5.59.13"
|
||||||
|
|
||||||
"@testing-library/dom@^9.0.0":
|
"@testing-library/dom@^9.0.0":
|
||||||
version "9.0.1"
|
version "9.0.1"
|
||||||
|
|
Loading…
Reference in New Issue