@tanstack/react-devtools 0.7.6 → 0.7.8
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/dist/esm/devtools.js +42 -33
- package/dist/esm/devtools.js.map +1 -1
- package/package.json +2 -2
- package/src/devtools.tsx +52 -40
package/dist/esm/devtools.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, useState, useEffect } from "react";
|
|
2
|
+
import { useRef, useState, useMemo, useEffect } from "react";
|
|
3
3
|
import { TanStackDevtoolsCore } from "@tanstack/devtools";
|
|
4
4
|
import { createPortal } from "react-dom";
|
|
5
5
|
const convertRender = (Component, setComponents, e, theme) => {
|
|
@@ -19,44 +19,53 @@ const TanStackDevtools = ({
|
|
|
19
19
|
const [titleContainers, setTitleContainers] = useState({});
|
|
20
20
|
const [PluginComponents, setPluginComponents] = useState({});
|
|
21
21
|
const [TitleComponents, setTitleComponents] = useState({});
|
|
22
|
+
const pluginsMap = useMemo(
|
|
23
|
+
() => plugins?.map((plugin) => {
|
|
24
|
+
return {
|
|
25
|
+
...plugin,
|
|
26
|
+
name: typeof plugin.name === "string" ? plugin.name : (e, theme) => {
|
|
27
|
+
const id = e.getAttribute("id");
|
|
28
|
+
const target = e.ownerDocument.getElementById(id);
|
|
29
|
+
if (target) {
|
|
30
|
+
setTitleContainers((prev) => ({
|
|
31
|
+
...prev,
|
|
32
|
+
[id]: e
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
convertRender(
|
|
36
|
+
plugin.name,
|
|
37
|
+
setTitleComponents,
|
|
38
|
+
e,
|
|
39
|
+
theme
|
|
40
|
+
);
|
|
41
|
+
},
|
|
42
|
+
render: (e, theme) => {
|
|
43
|
+
const id = e.getAttribute("id");
|
|
44
|
+
const target = e.ownerDocument.getElementById(id);
|
|
45
|
+
if (target) {
|
|
46
|
+
setPluginContainers((prev) => ({
|
|
47
|
+
...prev,
|
|
48
|
+
[id]: e
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
convertRender(plugin.render, setPluginComponents, e, theme);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}) ?? [],
|
|
55
|
+
[plugins]
|
|
56
|
+
);
|
|
22
57
|
const [devtools] = useState(
|
|
23
58
|
() => new TanStackDevtoolsCore({
|
|
24
59
|
config,
|
|
25
60
|
eventBusConfig,
|
|
26
|
-
plugins:
|
|
27
|
-
return {
|
|
28
|
-
...plugin,
|
|
29
|
-
name: typeof plugin.name === "string" ? plugin.name : (e, theme) => {
|
|
30
|
-
const id = e.getAttribute("id");
|
|
31
|
-
const target = e.ownerDocument.getElementById(id);
|
|
32
|
-
if (target) {
|
|
33
|
-
setTitleContainers((prev) => ({
|
|
34
|
-
...prev,
|
|
35
|
-
[id]: e
|
|
36
|
-
}));
|
|
37
|
-
}
|
|
38
|
-
convertRender(
|
|
39
|
-
plugin.name,
|
|
40
|
-
setTitleComponents,
|
|
41
|
-
e,
|
|
42
|
-
theme
|
|
43
|
-
);
|
|
44
|
-
},
|
|
45
|
-
render: (e, theme) => {
|
|
46
|
-
const id = e.getAttribute("id");
|
|
47
|
-
const target = e.ownerDocument.getElementById(id);
|
|
48
|
-
if (target) {
|
|
49
|
-
setPluginContainers((prev) => ({
|
|
50
|
-
...prev,
|
|
51
|
-
[id]: e
|
|
52
|
-
}));
|
|
53
|
-
}
|
|
54
|
-
convertRender(plugin.render, setPluginComponents, e, theme);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
})
|
|
61
|
+
plugins: pluginsMap
|
|
58
62
|
})
|
|
59
63
|
);
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
devtools.setConfig({
|
|
66
|
+
plugins: pluginsMap
|
|
67
|
+
});
|
|
68
|
+
}, [devtools, pluginsMap]);
|
|
60
69
|
useEffect(() => {
|
|
61
70
|
if (devToolRef.current) {
|
|
62
71
|
devtools.mount(devToolRef.current);
|
package/dist/esm/devtools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools.js","sources":["../../src/devtools.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react'\nimport { TanStackDevtoolsCore } from '@tanstack/devtools'\nimport { createPortal } from 'react-dom'\nimport type { JSX, ReactElement } from 'react'\nimport type {\n ClientEventBusConfig,\n TanStackDevtoolsConfig,\n TanStackDevtoolsPlugin,\n} from '@tanstack/devtools'\n\ntype PluginRender =\n | JSX.Element\n | ((el: HTMLElement, theme: 'dark' | 'light') => JSX.Element)\n\nexport type TanStackDevtoolsReactPlugin = Omit<\n TanStackDevtoolsPlugin,\n 'render' | 'name'\n> & {\n /**\n * The render function can be a React element or a function that returns a React element.\n * If it's a function, it will be called to render the plugin, otherwise it will be rendered directly.\n *\n * Example:\n * ```jsx\n * {\n * render: () => <CustomPluginComponent />,\n * }\n * ```\n * or\n * ```jsx\n * {\n * render: <CustomPluginComponent />,\n * }\n * ```\n */\n render: PluginRender\n /**\n * Name to be displayed in the devtools UI.\n * If a string, it will be used as the plugin name.\n * If a function, it will be called with the mount element.\n *\n * Example:\n * ```jsx\n * {\n * name: \"Your Plugin\",\n * render: () => <CustomPluginComponent />,\n * }\n * ```\n * or\n * ```jsx\n * {\n * name: <h1>Your Plugin title</h1>,\n * render: () => <CustomPluginComponent />,\n * }\n * ```\n */\n name: string | PluginRender\n}\n\nexport interface TanStackDevtoolsReactInit {\n /**\n * Array of plugins to be used in the devtools.\n * Each plugin should have a `render` function that returns a React element or a function\n *\n * Example:\n * ```jsx\n * <TanStackDevtools\n * plugins={[\n * {\n * id: \"your-plugin-id\",\n * name: \"Your Plugin\",\n * render: <CustomPluginComponent />,\n * }\n * ]}\n * />\n * ```\n */\n plugins?: Array<TanStackDevtoolsReactPlugin>\n /**\n * Configuration for the devtools shell. These configuration options are used to set the\n * initial state of the devtools when it is started for the first time. Afterwards,\n * the settings are persisted in local storage and changed through the settings panel.\n */\n config?: Partial<TanStackDevtoolsConfig>\n /**\n * Configuration for the TanStack Devtools client event bus.\n */\n eventBusConfig?: ClientEventBusConfig\n}\n\nconst convertRender = (\n Component: PluginRender,\n setComponents: React.Dispatch<\n React.SetStateAction<Record<string, JSX.Element>>\n >,\n e: HTMLElement,\n theme: 'dark' | 'light',\n) => {\n const element =\n typeof Component === 'function' ? Component(e, theme) : Component\n\n setComponents((prev) => ({\n ...prev,\n [e.getAttribute('id') as string]: element,\n }))\n}\n\nexport const TanStackDevtools = ({\n plugins,\n config,\n eventBusConfig,\n}: TanStackDevtoolsReactInit): ReactElement | null => {\n const devToolRef = useRef<HTMLDivElement>(null)\n\n const [pluginContainers, setPluginContainers] = useState<\n Record<string, HTMLElement>\n >({})\n const [titleContainers, setTitleContainers] = useState<\n Record<string, HTMLElement>\n >({})\n\n const [PluginComponents, setPluginComponents] = useState<\n Record<string, JSX.Element>\n >({})\n const [TitleComponents, setTitleComponents] = useState<\n Record<string, JSX.Element>\n >({})\n\n const
|
|
1
|
+
{"version":3,"file":"devtools.js","sources":["../../src/devtools.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useRef, useState } from 'react'\nimport { TanStackDevtoolsCore } from '@tanstack/devtools'\nimport { createPortal } from 'react-dom'\nimport type { JSX, ReactElement } from 'react'\nimport type {\n ClientEventBusConfig,\n TanStackDevtoolsConfig,\n TanStackDevtoolsPlugin,\n} from '@tanstack/devtools'\n\ntype PluginRender =\n | JSX.Element\n | ((el: HTMLElement, theme: 'dark' | 'light') => JSX.Element)\n\nexport type TanStackDevtoolsReactPlugin = Omit<\n TanStackDevtoolsPlugin,\n 'render' | 'name'\n> & {\n /**\n * The render function can be a React element or a function that returns a React element.\n * If it's a function, it will be called to render the plugin, otherwise it will be rendered directly.\n *\n * Example:\n * ```jsx\n * {\n * render: () => <CustomPluginComponent />,\n * }\n * ```\n * or\n * ```jsx\n * {\n * render: <CustomPluginComponent />,\n * }\n * ```\n */\n render: PluginRender\n /**\n * Name to be displayed in the devtools UI.\n * If a string, it will be used as the plugin name.\n * If a function, it will be called with the mount element.\n *\n * Example:\n * ```jsx\n * {\n * name: \"Your Plugin\",\n * render: () => <CustomPluginComponent />,\n * }\n * ```\n * or\n * ```jsx\n * {\n * name: <h1>Your Plugin title</h1>,\n * render: () => <CustomPluginComponent />,\n * }\n * ```\n */\n name: string | PluginRender\n}\n\nexport interface TanStackDevtoolsReactInit {\n /**\n * Array of plugins to be used in the devtools.\n * Each plugin should have a `render` function that returns a React element or a function\n *\n * Example:\n * ```jsx\n * <TanStackDevtools\n * plugins={[\n * {\n * id: \"your-plugin-id\",\n * name: \"Your Plugin\",\n * render: <CustomPluginComponent />,\n * }\n * ]}\n * />\n * ```\n */\n plugins?: Array<TanStackDevtoolsReactPlugin>\n /**\n * Configuration for the devtools shell. These configuration options are used to set the\n * initial state of the devtools when it is started for the first time. Afterwards,\n * the settings are persisted in local storage and changed through the settings panel.\n */\n config?: Partial<TanStackDevtoolsConfig>\n /**\n * Configuration for the TanStack Devtools client event bus.\n */\n eventBusConfig?: ClientEventBusConfig\n}\n\nconst convertRender = (\n Component: PluginRender,\n setComponents: React.Dispatch<\n React.SetStateAction<Record<string, JSX.Element>>\n >,\n e: HTMLElement,\n theme: 'dark' | 'light',\n) => {\n const element =\n typeof Component === 'function' ? Component(e, theme) : Component\n\n setComponents((prev) => ({\n ...prev,\n [e.getAttribute('id') as string]: element,\n }))\n}\n\nexport const TanStackDevtools = ({\n plugins,\n config,\n eventBusConfig,\n}: TanStackDevtoolsReactInit): ReactElement | null => {\n const devToolRef = useRef<HTMLDivElement>(null)\n\n const [pluginContainers, setPluginContainers] = useState<\n Record<string, HTMLElement>\n >({})\n const [titleContainers, setTitleContainers] = useState<\n Record<string, HTMLElement>\n >({})\n\n const [PluginComponents, setPluginComponents] = useState<\n Record<string, JSX.Element>\n >({})\n const [TitleComponents, setTitleComponents] = useState<\n Record<string, JSX.Element>\n >({})\n\n const pluginsMap: Array<TanStackDevtoolsPlugin> = useMemo(\n () =>\n plugins?.map((plugin) => {\n return {\n ...plugin,\n name:\n typeof plugin.name === 'string'\n ? plugin.name\n : (e, theme) => {\n const id = e.getAttribute('id')!\n const target = e.ownerDocument.getElementById(id)\n\n if (target) {\n setTitleContainers((prev) => ({\n ...prev,\n [id]: e,\n }))\n }\n\n convertRender(\n plugin.name as PluginRender,\n setTitleComponents,\n e,\n theme,\n )\n },\n render: (e, theme) => {\n const id = e.getAttribute('id')!\n const target = e.ownerDocument.getElementById(id)\n\n if (target) {\n setPluginContainers((prev) => ({\n ...prev,\n [id]: e,\n }))\n }\n\n convertRender(plugin.render, setPluginComponents, e, theme)\n },\n }\n }) ?? [],\n [plugins],\n )\n\n const [devtools] = useState(\n () =>\n new TanStackDevtoolsCore({\n config,\n eventBusConfig,\n plugins: pluginsMap,\n }),\n )\n\n useEffect(() => {\n devtools.setConfig({\n plugins: pluginsMap,\n })\n }, [devtools, pluginsMap])\n\n useEffect(() => {\n if (devToolRef.current) {\n devtools.mount(devToolRef.current)\n }\n\n return () => devtools.unmount()\n }, [devtools])\n\n const hasPlugins =\n Object.values(pluginContainers).length > 0 &&\n Object.values(PluginComponents).length > 0\n const hasTitles =\n Object.values(titleContainers).length > 0 &&\n Object.values(TitleComponents).length > 0\n\n return (\n <>\n <div style={{ position: 'absolute' }} ref={devToolRef} />\n\n {hasPlugins\n ? Object.entries(pluginContainers).map(([key, pluginContainer]) =>\n createPortal(<>{PluginComponents[key]}</>, pluginContainer),\n )\n : null}\n\n {hasTitles\n ? Object.entries(titleContainers).map(([key, titleContainer]) =>\n createPortal(<>{TitleComponents[key]}</>, titleContainer),\n )\n : null}\n </>\n )\n}\n"],"names":[],"mappings":";;;;AA0FA,MAAM,gBAAgB,CACpB,WACA,eAGA,GACA,UACG;AACH,QAAM,UACJ,OAAO,cAAc,aAAa,UAAU,GAAG,KAAK,IAAI;AAE1D,gBAAc,CAAC,UAAU;AAAA,IACvB,GAAG;AAAA,IACH,CAAC,EAAE,aAAa,IAAI,CAAW,GAAG;AAAA,EAAA,EAClC;AACJ;AAEO,MAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AACF,MAAsD;AACpD,QAAM,aAAa,OAAuB,IAAI;AAE9C,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAE9C,CAAA,CAAE;AACJ,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,SAE5C,CAAA,CAAE;AAEJ,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAE9C,CAAA,CAAE;AACJ,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,SAE5C,CAAA,CAAE;AAEJ,QAAM,aAA4C;AAAA,IAChD,MACE,SAAS,IAAI,CAAC,WAAW;AACvB,aAAO;AAAA,QACL,GAAG;AAAA,QACH,MACE,OAAO,OAAO,SAAS,WACnB,OAAO,OACP,CAAC,GAAG,UAAU;AACZ,gBAAM,KAAK,EAAE,aAAa,IAAI;AAC9B,gBAAM,SAAS,EAAE,cAAc,eAAe,EAAE;AAEhD,cAAI,QAAQ;AACV,+BAAmB,CAAC,UAAU;AAAA,cAC5B,GAAG;AAAA,cACH,CAAC,EAAE,GAAG;AAAA,YAAA,EACN;AAAA,UACJ;AAEA;AAAA,YACE,OAAO;AAAA,YACP;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,QAEJ;AAAA,QACN,QAAQ,CAAC,GAAG,UAAU;AACpB,gBAAM,KAAK,EAAE,aAAa,IAAI;AAC9B,gBAAM,SAAS,EAAE,cAAc,eAAe,EAAE;AAEhD,cAAI,QAAQ;AACV,gCAAoB,CAAC,UAAU;AAAA,cAC7B,GAAG;AAAA,cACH,CAAC,EAAE,GAAG;AAAA,YAAA,EACN;AAAA,UACJ;AAEA,wBAAc,OAAO,QAAQ,qBAAqB,GAAG,KAAK;AAAA,QAC5D;AAAA,MAAA;AAAA,IAEJ,CAAC,KAAK,CAAA;AAAA,IACR,CAAC,OAAO;AAAA,EAAA;AAGV,QAAM,CAAC,QAAQ,IAAI;AAAA,IACjB,MACE,IAAI,qBAAqB;AAAA,MACvB;AAAA,MACA;AAAA,MACA,SAAS;AAAA,IAAA,CACV;AAAA,EAAA;AAGL,YAAU,MAAM;AACd,aAAS,UAAU;AAAA,MACjB,SAAS;AAAA,IAAA,CACV;AAAA,EACH,GAAG,CAAC,UAAU,UAAU,CAAC;AAEzB,YAAU,MAAM;AACd,QAAI,WAAW,SAAS;AACtB,eAAS,MAAM,WAAW,OAAO;AAAA,IACnC;AAEA,WAAO,MAAM,SAAS,QAAA;AAAA,EACxB,GAAG,CAAC,QAAQ,CAAC;AAEb,QAAM,aACJ,OAAO,OAAO,gBAAgB,EAAE,SAAS,KACzC,OAAO,OAAO,gBAAgB,EAAE,SAAS;AAC3C,QAAM,YACJ,OAAO,OAAO,eAAe,EAAE,SAAS,KACxC,OAAO,OAAO,eAAe,EAAE,SAAS;AAE1C,SACE,qBAAA,UAAA,EACE,UAAA;AAAA,IAAA,oBAAC,SAAI,OAAO,EAAE,UAAU,WAAA,GAAc,KAAK,YAAY;AAAA,IAEtD,aACG,OAAO,QAAQ,gBAAgB,EAAE;AAAA,MAAI,CAAC,CAAC,KAAK,eAAe,MACzD,aAAa,oBAAA,UAAA,EAAG,UAAA,iBAAiB,GAAG,EAAA,CAAE,GAAK,eAAe;AAAA,IAAA,IAE5D;AAAA,IAEH,YACG,OAAO,QAAQ,eAAe,EAAE;AAAA,MAAI,CAAC,CAAC,KAAK,cAAc,MACvD,aAAa,oBAAA,UAAA,EAAG,UAAA,gBAAgB,GAAG,EAAA,CAAE,GAAK,cAAc;AAAA,IAAA,IAE1D;AAAA,EAAA,GACN;AAEJ;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-devtools",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.8",
|
|
4
4
|
"description": "TanStack Devtools is a set of tools for building advanced devtools for your React application.",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"src"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@tanstack/devtools": "0.6.
|
|
42
|
+
"@tanstack/devtools": "0.6.22"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@eslint-react/eslint-plugin": "^1.53.1",
|
package/src/devtools.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect, useRef, useState } from 'react'
|
|
1
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react'
|
|
2
2
|
import { TanStackDevtoolsCore } from '@tanstack/devtools'
|
|
3
3
|
import { createPortal } from 'react-dom'
|
|
4
4
|
import type { JSX, ReactElement } from 'react'
|
|
@@ -126,53 +126,65 @@ export const TanStackDevtools = ({
|
|
|
126
126
|
Record<string, JSX.Element>
|
|
127
127
|
>({})
|
|
128
128
|
|
|
129
|
+
const pluginsMap: Array<TanStackDevtoolsPlugin> = useMemo(
|
|
130
|
+
() =>
|
|
131
|
+
plugins?.map((plugin) => {
|
|
132
|
+
return {
|
|
133
|
+
...plugin,
|
|
134
|
+
name:
|
|
135
|
+
typeof plugin.name === 'string'
|
|
136
|
+
? plugin.name
|
|
137
|
+
: (e, theme) => {
|
|
138
|
+
const id = e.getAttribute('id')!
|
|
139
|
+
const target = e.ownerDocument.getElementById(id)
|
|
140
|
+
|
|
141
|
+
if (target) {
|
|
142
|
+
setTitleContainers((prev) => ({
|
|
143
|
+
...prev,
|
|
144
|
+
[id]: e,
|
|
145
|
+
}))
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
convertRender(
|
|
149
|
+
plugin.name as PluginRender,
|
|
150
|
+
setTitleComponents,
|
|
151
|
+
e,
|
|
152
|
+
theme,
|
|
153
|
+
)
|
|
154
|
+
},
|
|
155
|
+
render: (e, theme) => {
|
|
156
|
+
const id = e.getAttribute('id')!
|
|
157
|
+
const target = e.ownerDocument.getElementById(id)
|
|
158
|
+
|
|
159
|
+
if (target) {
|
|
160
|
+
setPluginContainers((prev) => ({
|
|
161
|
+
...prev,
|
|
162
|
+
[id]: e,
|
|
163
|
+
}))
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
convertRender(plugin.render, setPluginComponents, e, theme)
|
|
167
|
+
},
|
|
168
|
+
}
|
|
169
|
+
}) ?? [],
|
|
170
|
+
[plugins],
|
|
171
|
+
)
|
|
172
|
+
|
|
129
173
|
const [devtools] = useState(
|
|
130
174
|
() =>
|
|
131
175
|
new TanStackDevtoolsCore({
|
|
132
176
|
config,
|
|
133
177
|
eventBusConfig,
|
|
134
|
-
plugins:
|
|
135
|
-
return {
|
|
136
|
-
...plugin,
|
|
137
|
-
name:
|
|
138
|
-
typeof plugin.name === 'string'
|
|
139
|
-
? plugin.name
|
|
140
|
-
: (e, theme) => {
|
|
141
|
-
const id = e.getAttribute('id')!
|
|
142
|
-
const target = e.ownerDocument.getElementById(id)
|
|
143
|
-
|
|
144
|
-
if (target) {
|
|
145
|
-
setTitleContainers((prev) => ({
|
|
146
|
-
...prev,
|
|
147
|
-
[id]: e,
|
|
148
|
-
}))
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
convertRender(
|
|
152
|
-
plugin.name as PluginRender,
|
|
153
|
-
setTitleComponents,
|
|
154
|
-
e,
|
|
155
|
-
theme,
|
|
156
|
-
)
|
|
157
|
-
},
|
|
158
|
-
render: (e, theme) => {
|
|
159
|
-
const id = e.getAttribute('id')!
|
|
160
|
-
const target = e.ownerDocument.getElementById(id)
|
|
161
|
-
|
|
162
|
-
if (target) {
|
|
163
|
-
setPluginContainers((prev) => ({
|
|
164
|
-
...prev,
|
|
165
|
-
[id]: e,
|
|
166
|
-
}))
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
convertRender(plugin.render, setPluginComponents, e, theme)
|
|
170
|
-
},
|
|
171
|
-
}
|
|
172
|
-
}),
|
|
178
|
+
plugins: pluginsMap,
|
|
173
179
|
}),
|
|
174
180
|
)
|
|
175
181
|
|
|
182
|
+
useEffect(() => {
|
|
183
|
+
devtools.setConfig({
|
|
184
|
+
plugins: pluginsMap,
|
|
185
|
+
})
|
|
186
|
+
}, [devtools, pluginsMap])
|
|
187
|
+
|
|
176
188
|
useEffect(() => {
|
|
177
189
|
if (devToolRef.current) {
|
|
178
190
|
devtools.mount(devToolRef.current)
|