@tanstack/react-query-devtools 5.0.0-alpha.27 → 5.0.0-alpha.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/devtools.d.ts.map +1 -1
- package/build/lib/devtools.esm.js +5 -1
- package/build/lib/devtools.esm.js.map +1 -1
- package/build/lib/devtools.js +5 -1
- package/build/lib/devtools.js.map +1 -1
- package/build/lib/devtools.mjs +5 -1
- package/build/lib/devtools.mjs.map +1 -1
- package/build/lib/index.prod.esm.js +14 -6
- package/build/lib/index.prod.esm.js.map +1 -1
- package/build/lib/index.prod.js +14 -6
- package/build/lib/index.prod.js.map +1 -1
- package/build/lib/index.prod.mjs +14 -6
- package/build/lib/index.prod.mjs.map +1 -1
- package/build/umd/index.development.js +14 -6
- package/build/umd/index.development.js.map +1 -1
- package/package.json +2 -2
- package/src/devtools.tsx +6 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools.d.ts","sourceRoot":"","sources":["../../src/devtools.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EACV,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;;OAIG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAA;IACvC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAA;CACjC;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,eAAe,GACrB,KAAK,CAAC,YAAY,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"devtools.d.ts","sourceRoot":"","sources":["../../src/devtools.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EACV,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;;OAIG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAA;IACvC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAA;CACjC;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,eAAe,GACrB,KAAK,CAAC,YAAY,GAAG,IAAI,CAqD3B"}
|
|
@@ -5,6 +5,7 @@ import { TanstackQueryDevtools } from '@tanstack/query-devtools';
|
|
|
5
5
|
|
|
6
6
|
function ReactQueryDevtools(props) {
|
|
7
7
|
const queryClient = useQueryClient();
|
|
8
|
+
const client = props.client || queryClient;
|
|
8
9
|
const ref = useRef(null);
|
|
9
10
|
const {
|
|
10
11
|
buttonPosition,
|
|
@@ -13,7 +14,7 @@ function ReactQueryDevtools(props) {
|
|
|
13
14
|
errorTypes
|
|
14
15
|
} = props;
|
|
15
16
|
const [devtools] = useState(new TanstackQueryDevtools({
|
|
16
|
-
client:
|
|
17
|
+
client: client,
|
|
17
18
|
queryFlavor: 'React Query',
|
|
18
19
|
version: '5',
|
|
19
20
|
onlineManager,
|
|
@@ -22,6 +23,9 @@ function ReactQueryDevtools(props) {
|
|
|
22
23
|
initialIsOpen,
|
|
23
24
|
errorTypes
|
|
24
25
|
}));
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
devtools.setClient(client);
|
|
28
|
+
}, [client, devtools]);
|
|
25
29
|
useEffect(() => {
|
|
26
30
|
if (buttonPosition) {
|
|
27
31
|
devtools.setButtonPosition(buttonPosition);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools.esm.js","sources":["../../src/devtools.tsx"],"sourcesContent":["'use client'\nimport { useRef, useState, useEffect } from 'react'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useQueryClient, onlineManager } from '@tanstack/react-query'\nimport type {\n DevtoolsButtonPosition,\n DevtoolsPosition,\n DevToolsErrorType,\n} from '@tanstack/query-devtools'\nimport { TanstackQueryDevtools } from '@tanstack/query-devtools'\nimport React from 'react'\nexport interface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * The position of the React Query logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n * Defaults to 'bottom-left'.\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the React Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n * Defaults to 'bottom'.\n */\n position?: DevtoolsPosition\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: DevToolsErrorType[]\n}\n\nexport function ReactQueryDevtools(\n props: DevtoolsOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient()\n const ref = useRef<HTMLDivElement>(null)\n const { buttonPosition, position, initialIsOpen, errorTypes } = props\n const [devtools] = useState(\n new TanstackQueryDevtools({\n client:
|
|
1
|
+
{"version":3,"file":"devtools.esm.js","sources":["../../src/devtools.tsx"],"sourcesContent":["'use client'\nimport { useRef, useState, useEffect } from 'react'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useQueryClient, onlineManager } from '@tanstack/react-query'\nimport type {\n DevtoolsButtonPosition,\n DevtoolsPosition,\n DevToolsErrorType,\n} from '@tanstack/query-devtools'\nimport { TanstackQueryDevtools } from '@tanstack/query-devtools'\nimport React from 'react'\nexport interface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * The position of the React Query logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n * Defaults to 'bottom-left'.\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the React Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n * Defaults to 'bottom'.\n */\n position?: DevtoolsPosition\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: DevToolsErrorType[]\n}\n\nexport function ReactQueryDevtools(\n props: DevtoolsOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient()\n const client = props.client || queryClient\n const ref = useRef<HTMLDivElement>(null)\n const { buttonPosition, position, initialIsOpen, errorTypes } = props\n const [devtools] = useState(\n new TanstackQueryDevtools({\n client: client,\n queryFlavor: 'React Query',\n version: '5',\n onlineManager,\n buttonPosition,\n position,\n initialIsOpen,\n errorTypes,\n }),\n )\n\n useEffect(() => {\n devtools.setClient(client)\n }, [client, devtools])\n\n useEffect(() => {\n if (buttonPosition) {\n devtools.setButtonPosition(buttonPosition)\n }\n }, [buttonPosition, devtools])\n\n useEffect(() => {\n if (position) {\n devtools.setPosition(position)\n }\n }, [position, devtools])\n\n useEffect(() => {\n devtools.setInitialIsOpen(initialIsOpen || false)\n }, [initialIsOpen, devtools])\n\n useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return <div ref={ref}></div>\n}\n"],"names":["errorTypes","client","queryFlavor","version","useEffect","devtools"],"mappings":";;;;;AAsCO;;AAIL;AACA;;;;;AACiDA;AAAW;;AAGxDC;AACAC;AACAC;;;;;AAKAH;AACF;AAGFI;AACEC;AACF;AAEAD;AACE;AACEC;AACF;AACF;AAEAD;AACE;AACEC;AACF;AACF;AAEAD;AACEC;AACF;AAEAD;AACEC;AACF;AAEAD;;AAEIC;AACF;AAEA;;;AAGF;;AAEY;;AACd;;"}
|
package/build/lib/devtools.js
CHANGED
|
@@ -7,6 +7,7 @@ var queryDevtools = require('@tanstack/query-devtools');
|
|
|
7
7
|
|
|
8
8
|
function ReactQueryDevtools(props) {
|
|
9
9
|
const queryClient = reactQuery.useQueryClient();
|
|
10
|
+
const client = props.client || queryClient;
|
|
10
11
|
const ref = React.useRef(null);
|
|
11
12
|
const {
|
|
12
13
|
buttonPosition,
|
|
@@ -15,7 +16,7 @@ function ReactQueryDevtools(props) {
|
|
|
15
16
|
errorTypes
|
|
16
17
|
} = props;
|
|
17
18
|
const [devtools] = React.useState(new queryDevtools.TanstackQueryDevtools({
|
|
18
|
-
client:
|
|
19
|
+
client: client,
|
|
19
20
|
queryFlavor: 'React Query',
|
|
20
21
|
version: '5',
|
|
21
22
|
onlineManager: reactQuery.onlineManager,
|
|
@@ -24,6 +25,9 @@ function ReactQueryDevtools(props) {
|
|
|
24
25
|
initialIsOpen,
|
|
25
26
|
errorTypes
|
|
26
27
|
}));
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
devtools.setClient(client);
|
|
30
|
+
}, [client, devtools]);
|
|
27
31
|
React.useEffect(() => {
|
|
28
32
|
if (buttonPosition) {
|
|
29
33
|
devtools.setButtonPosition(buttonPosition);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools.js","sources":["../../src/devtools.tsx"],"sourcesContent":["'use client'\nimport { useRef, useState, useEffect } from 'react'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useQueryClient, onlineManager } from '@tanstack/react-query'\nimport type {\n DevtoolsButtonPosition,\n DevtoolsPosition,\n DevToolsErrorType,\n} from '@tanstack/query-devtools'\nimport { TanstackQueryDevtools } from '@tanstack/query-devtools'\nimport React from 'react'\nexport interface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * The position of the React Query logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n * Defaults to 'bottom-left'.\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the React Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n * Defaults to 'bottom'.\n */\n position?: DevtoolsPosition\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: DevToolsErrorType[]\n}\n\nexport function ReactQueryDevtools(\n props: DevtoolsOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient()\n const ref = useRef<HTMLDivElement>(null)\n const { buttonPosition, position, initialIsOpen, errorTypes } = props\n const [devtools] = useState(\n new TanstackQueryDevtools({\n client:
|
|
1
|
+
{"version":3,"file":"devtools.js","sources":["../../src/devtools.tsx"],"sourcesContent":["'use client'\nimport { useRef, useState, useEffect } from 'react'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useQueryClient, onlineManager } from '@tanstack/react-query'\nimport type {\n DevtoolsButtonPosition,\n DevtoolsPosition,\n DevToolsErrorType,\n} from '@tanstack/query-devtools'\nimport { TanstackQueryDevtools } from '@tanstack/query-devtools'\nimport React from 'react'\nexport interface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * The position of the React Query logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n * Defaults to 'bottom-left'.\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the React Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n * Defaults to 'bottom'.\n */\n position?: DevtoolsPosition\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: DevToolsErrorType[]\n}\n\nexport function ReactQueryDevtools(\n props: DevtoolsOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient()\n const client = props.client || queryClient\n const ref = useRef<HTMLDivElement>(null)\n const { buttonPosition, position, initialIsOpen, errorTypes } = props\n const [devtools] = useState(\n new TanstackQueryDevtools({\n client: client,\n queryFlavor: 'React Query',\n version: '5',\n onlineManager,\n buttonPosition,\n position,\n initialIsOpen,\n errorTypes,\n }),\n )\n\n useEffect(() => {\n devtools.setClient(client)\n }, [client, devtools])\n\n useEffect(() => {\n if (buttonPosition) {\n devtools.setButtonPosition(buttonPosition)\n }\n }, [buttonPosition, devtools])\n\n useEffect(() => {\n if (position) {\n devtools.setPosition(position)\n }\n }, [position, devtools])\n\n useEffect(() => {\n devtools.setInitialIsOpen(initialIsOpen || false)\n }, [initialIsOpen, devtools])\n\n useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return <div ref={ref}></div>\n}\n"],"names":["errorTypes","client","queryFlavor","version","useEffect","devtools"],"mappings":";;;;;;;AAsCO;;AAIL;AACA;;;;;AACiDA;AAAW;;AAGxDC;AACAC;AACAC;;;;;AAKAH;AACF;AAGFI;AACEC;AACF;AAEAD;AACE;AACEC;AACF;AACF;AAEAD;AACE;AACEC;AACF;AACF;AAEAD;AACEC;AACF;AAEAD;AACEC;AACF;AAEAD;;AAEIC;AACF;AAEA;;;AAGF;;AAEY;;AACd;;"}
|
package/build/lib/devtools.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import { TanstackQueryDevtools } from '@tanstack/query-devtools';
|
|
|
5
5
|
|
|
6
6
|
function ReactQueryDevtools(props) {
|
|
7
7
|
const queryClient = useQueryClient();
|
|
8
|
+
const client = props.client || queryClient;
|
|
8
9
|
const ref = useRef(null);
|
|
9
10
|
const {
|
|
10
11
|
buttonPosition,
|
|
@@ -13,7 +14,7 @@ function ReactQueryDevtools(props) {
|
|
|
13
14
|
errorTypes
|
|
14
15
|
} = props;
|
|
15
16
|
const [devtools] = useState(new TanstackQueryDevtools({
|
|
16
|
-
client:
|
|
17
|
+
client: client,
|
|
17
18
|
queryFlavor: 'React Query',
|
|
18
19
|
version: '5',
|
|
19
20
|
onlineManager,
|
|
@@ -22,6 +23,9 @@ function ReactQueryDevtools(props) {
|
|
|
22
23
|
initialIsOpen,
|
|
23
24
|
errorTypes
|
|
24
25
|
}));
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
devtools.setClient(client);
|
|
28
|
+
}, [client, devtools]);
|
|
25
29
|
useEffect(() => {
|
|
26
30
|
if (buttonPosition) {
|
|
27
31
|
devtools.setButtonPosition(buttonPosition);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools.mjs","sources":["../../src/devtools.tsx"],"sourcesContent":["'use client'\nimport { useRef, useState, useEffect } from 'react'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useQueryClient, onlineManager } from '@tanstack/react-query'\nimport type {\n DevtoolsButtonPosition,\n DevtoolsPosition,\n DevToolsErrorType,\n} from '@tanstack/query-devtools'\nimport { TanstackQueryDevtools } from '@tanstack/query-devtools'\nimport React from 'react'\nexport interface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * The position of the React Query logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n * Defaults to 'bottom-left'.\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the React Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n * Defaults to 'bottom'.\n */\n position?: DevtoolsPosition\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: DevToolsErrorType[]\n}\n\nexport function ReactQueryDevtools(\n props: DevtoolsOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient()\n const ref = useRef<HTMLDivElement>(null)\n const { buttonPosition, position, initialIsOpen, errorTypes } = props\n const [devtools] = useState(\n new TanstackQueryDevtools({\n client:
|
|
1
|
+
{"version":3,"file":"devtools.mjs","sources":["../../src/devtools.tsx"],"sourcesContent":["'use client'\nimport { useRef, useState, useEffect } from 'react'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useQueryClient, onlineManager } from '@tanstack/react-query'\nimport type {\n DevtoolsButtonPosition,\n DevtoolsPosition,\n DevToolsErrorType,\n} from '@tanstack/query-devtools'\nimport { TanstackQueryDevtools } from '@tanstack/query-devtools'\nimport React from 'react'\nexport interface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * The position of the React Query logo to open and close the devtools panel.\n * 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n * Defaults to 'bottom-left'.\n */\n buttonPosition?: DevtoolsButtonPosition\n /**\n * The position of the React Query devtools panel.\n * 'top' | 'bottom' | 'left' | 'right'\n * Defaults to 'bottom'.\n */\n position?: DevtoolsPosition\n /**\n * Custom instance of QueryClient\n */\n client?: QueryClient\n /**\n * Use this so you can define custom errors that can be shown in the devtools.\n */\n errorTypes?: DevToolsErrorType[]\n}\n\nexport function ReactQueryDevtools(\n props: DevtoolsOptions,\n): React.ReactElement | null {\n const queryClient = useQueryClient()\n const client = props.client || queryClient\n const ref = useRef<HTMLDivElement>(null)\n const { buttonPosition, position, initialIsOpen, errorTypes } = props\n const [devtools] = useState(\n new TanstackQueryDevtools({\n client: client,\n queryFlavor: 'React Query',\n version: '5',\n onlineManager,\n buttonPosition,\n position,\n initialIsOpen,\n errorTypes,\n }),\n )\n\n useEffect(() => {\n devtools.setClient(client)\n }, [client, devtools])\n\n useEffect(() => {\n if (buttonPosition) {\n devtools.setButtonPosition(buttonPosition)\n }\n }, [buttonPosition, devtools])\n\n useEffect(() => {\n if (position) {\n devtools.setPosition(position)\n }\n }, [position, devtools])\n\n useEffect(() => {\n devtools.setInitialIsOpen(initialIsOpen || false)\n }, [initialIsOpen, devtools])\n\n useEffect(() => {\n devtools.setErrorTypes(errorTypes || [])\n }, [errorTypes, devtools])\n\n useEffect(() => {\n if (ref.current) {\n devtools.mount(ref.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return <div ref={ref}></div>\n}\n"],"names":["errorTypes","client","queryFlavor","version","useEffect","devtools"],"mappings":";;;;;AAsCO;;AAIL;AACA;;;;;AACiDA;AAAW;;AAGxDC;AACAC;AACAC;;;;;AAKAH;AACF;AAGFI;AACEC;AACF;AAEAD;AACE;AACEC;AACF;AACF;AAEAD;AACE;AACEC;AACF;AACF;AAEAD;AACEC;AACF;AAEAD;AACEC;AACF;AAEAD;;AAEIC;AACF;AAEA;;;AAGF;;AAEY;;AACd;;"}
|
|
@@ -7816,7 +7816,7 @@ const getStyles = () => {
|
|
|
7816
7816
|
background-color: ${colors.darkGray[400]};
|
|
7817
7817
|
font-size: ${font.size.sm};
|
|
7818
7818
|
color: ${colors.gray[500]};
|
|
7819
|
-
z-index:
|
|
7819
|
+
z-index: 7;
|
|
7820
7820
|
`,
|
|
7821
7821
|
settingsMenuHeader: css`
|
|
7822
7822
|
padding: ${tokens.size[1.5]} ${tokens.size[2.5]};
|
|
@@ -7875,7 +7875,7 @@ class TanstackQueryDevtools {
|
|
|
7875
7875
|
initialIsOpen,
|
|
7876
7876
|
errorTypes
|
|
7877
7877
|
} = config;
|
|
7878
|
-
this.client = client;
|
|
7878
|
+
this.client = createSignal(client);
|
|
7879
7879
|
this.queryFlavor = queryFlavor;
|
|
7880
7880
|
this.version = version;
|
|
7881
7881
|
this.onlineManager = onlineManager;
|
|
@@ -7896,6 +7896,9 @@ class TanstackQueryDevtools {
|
|
|
7896
7896
|
setErrorTypes(errorTypes) {
|
|
7897
7897
|
this.errorTypes[1](errorTypes);
|
|
7898
7898
|
}
|
|
7899
|
+
setClient(client) {
|
|
7900
|
+
this.client[1](client);
|
|
7901
|
+
}
|
|
7899
7902
|
mount(el) {
|
|
7900
7903
|
if (this.isMounted) {
|
|
7901
7904
|
throw new Error('Devtools is already mounted');
|
|
@@ -7905,11 +7908,9 @@ class TanstackQueryDevtools {
|
|
|
7905
7908
|
const [pos] = this.position;
|
|
7906
7909
|
const [isOpen] = this.initialIsOpen;
|
|
7907
7910
|
const [errors] = this.errorTypes;
|
|
7911
|
+
const [queryClient] = this.client;
|
|
7908
7912
|
const _self$ = this;
|
|
7909
7913
|
return createComponent(DevtoolsComponent, mergeProps({
|
|
7910
|
-
get client() {
|
|
7911
|
-
return _self$.client;
|
|
7912
|
-
},
|
|
7913
7914
|
get queryFlavor() {
|
|
7914
7915
|
return _self$.queryFlavor;
|
|
7915
7916
|
},
|
|
@@ -7920,6 +7921,9 @@ class TanstackQueryDevtools {
|
|
|
7920
7921
|
return _self$.onlineManager;
|
|
7921
7922
|
}
|
|
7922
7923
|
}, {
|
|
7924
|
+
get client() {
|
|
7925
|
+
return queryClient();
|
|
7926
|
+
},
|
|
7923
7927
|
get buttonPosition() {
|
|
7924
7928
|
return btnPosition();
|
|
7925
7929
|
},
|
|
@@ -7948,6 +7952,7 @@ class TanstackQueryDevtools {
|
|
|
7948
7952
|
|
|
7949
7953
|
function ReactQueryDevtools$1(props) {
|
|
7950
7954
|
const queryClient = useQueryClient();
|
|
7955
|
+
const client = props.client || queryClient;
|
|
7951
7956
|
const ref = useRef(null);
|
|
7952
7957
|
const {
|
|
7953
7958
|
buttonPosition,
|
|
@@ -7956,7 +7961,7 @@ function ReactQueryDevtools$1(props) {
|
|
|
7956
7961
|
errorTypes
|
|
7957
7962
|
} = props;
|
|
7958
7963
|
const [devtools] = useState(new TanstackQueryDevtools({
|
|
7959
|
-
client:
|
|
7964
|
+
client: client,
|
|
7960
7965
|
queryFlavor: 'React Query',
|
|
7961
7966
|
version: '5',
|
|
7962
7967
|
onlineManager,
|
|
@@ -7965,6 +7970,9 @@ function ReactQueryDevtools$1(props) {
|
|
|
7965
7970
|
initialIsOpen,
|
|
7966
7971
|
errorTypes
|
|
7967
7972
|
}));
|
|
7973
|
+
useEffect(() => {
|
|
7974
|
+
devtools.setClient(client);
|
|
7975
|
+
}, [client, devtools]);
|
|
7968
7976
|
useEffect(() => {
|
|
7969
7977
|
if (buttonPosition) {
|
|
7970
7978
|
devtools.setButtonPosition(buttonPosition);
|