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 4949 "import/no-cycle": "error",
5050 "import/no-unresolved": ["error", { "ignore": ["^@tanstack\/"] }],
5151 "import/no-unused-modules": ["off", { "unusedExports": true }],
52- "no-redeclare": "off"
52+ "no-redeclare": "off",
53+ "react-hooks/exhaustive-deps": "error"
5354 }
5455}
Original file line number Diff line number Diff line change @@ -192,12 +192,13 @@ export function ReactQueryDevtools({
192192
193193 React . useEffect ( ( ) => {
194194 if ( isResolvedOpen ) {
195- const previousValue = rootRef . current ?. parentElement ?. style . paddingBottom
195+ const root = rootRef . current
196+ const previousValue = root ?. parentElement ?. style . paddingBottom
196197
197198 const run = ( ) => {
198199 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`
201202 }
202203 }
203204
@@ -208,11 +209,8 @@ export function ReactQueryDevtools({
208209
209210 return ( ) => {
210211 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
216214 }
217215 }
218216 }
You can’t perform that action at this time.
0 commit comments