Skip to content

Commit cf8428b

Browse files
committed
chore: alias plugin and title state
1 parent b5b70fa commit cf8428b

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

‎packages/react-devtools/src/devtools.tsx‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,19 +181,24 @@ export const TanStackDevtools = ({
181181
return () => devtools.unmount()
182182
}, [devtools])
183183

184+
const hasPlugins =
185+
Object.values(pluginContainers).length > 0 &&
186+
Object.values(PluginComponents).length > 0
187+
const hasTitles =
188+
Object.values(titleContainers).length > 0 &&
189+
Object.values(TitleComponents).length > 0
190+
184191
return (
185192
<>
186193
<div style={{ position: 'absolute' }} ref={devToolRef} />
187194

188-
{Object.values(pluginContainers).length > 0 &&
189-
Object.values(PluginComponents).length > 0
195+
{hasPlugins
190196
? Object.entries(pluginContainers).map(([key, pluginContainer]) =>
191197
createPortal(<>{PluginComponents[key]}</>, pluginContainer),
192198
)
193199
: null}
194200

195-
{Object.values(titleContainers).length > 0 &&
196-
Object.values(TitleComponents).length > 0
201+
{hasTitles
197202
? Object.entries(titleContainers).map(([key, titleContainer]) =>
198203
createPortal(<>{TitleComponents[key]}</>, titleContainer),
199204
)

0 commit comments

Comments
 (0)