File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
packages/react-query-devtools/src Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 49
49
"import/no-cycle": "error",
50
50
"import/no-unresolved": ["error", { "ignore": ["^@tanstack\/"] }],
51
51
"import/no-unused-modules": ["off", { "unusedExports": true }],
52
- "no-redeclare": "off"
52
+ "no-redeclare": "off",
53
+ "react-hooks/exhaustive-deps": "error"
53
54
}
54
55
}
Original file line number Diff line number Diff line change @@ -192,12 +192,13 @@ export function ReactQueryDevtools({
192
192
193
193
React . useEffect ( ( ) => {
194
194
if ( isResolvedOpen ) {
195
- const previousValue = rootRef . current ?. parentElement ?. style . paddingBottom
195
+ const root = rootRef . current
196
+ const previousValue = root ?. parentElement ?. style . paddingBottom
196
197
197
198
const run = ( ) => {
198
199
const containerHeight = panelRef . current ?. getBoundingClientRect ( ) . height
199
- if ( rootRef . current ?. parentElement ) {
200
- rootRef . current . parentElement . style . paddingBottom = `${ containerHeight } px`
200
+ if ( root ?. parentElement ) {
201
+ root . parentElement . style . paddingBottom = `${ containerHeight } px`
201
202
}
202
203
}
203
204
@@ -208,11 +209,8 @@ export function ReactQueryDevtools({
208
209
209
210
return ( ) => {
210
211
window . removeEventListener ( 'resize' , run )
211
- if (
212
- rootRef . current ?. parentElement &&
213
- typeof previousValue === 'string'
214
- ) {
215
- rootRef . current . parentElement . style . paddingBottom = previousValue
212
+ if ( root ?. parentElement && typeof previousValue === 'string' ) {
213
+ root . parentElement . style . paddingBottom = previousValue
216
214
}
217
215
}
218
216
}
You can’t perform that action at this time.
0 commit comments