Skip to content

Commit e3fc1aa

Browse files
committed
chore: reuse identifiers
1 parent c1a3ccc commit e3fc1aa

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

packages/react-devtools/src/devtools.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,13 @@ export const TanStackDevtools = ({
138138
typeof plugin.name === 'string'
139139
? plugin.name
140140
: (e, theme) => {
141-
const target = e.ownerDocument.getElementById(
142-
e.getAttribute('id')!,
143-
)
141+
const id = e.getAttribute('id')!
142+
const target = e.ownerDocument.getElementById(id)
144143

145144
if (target) {
146145
setTitleContainers((prev) => ({
147146
...prev,
148-
[e.getAttribute('id') as string]: e,
147+
[id]: e,
149148
}))
150149
}
151150

@@ -157,14 +156,13 @@ export const TanStackDevtools = ({
157156
)
158157
},
159158
render: (e, theme) => {
160-
const target = e.ownerDocument.getElementById(
161-
e.getAttribute('id')!,
162-
)
159+
const id = e.getAttribute('id')!
160+
const target = e.ownerDocument.getElementById(id)
163161

164162
if (target) {
165163
setPluginContainers((prev) => ({
166164
...prev,
167-
[e.getAttribute('id') as string]: e,
165+
[id]: e,
168166
}))
169167
}
170168

0 commit comments

Comments
 (0)