From 93b8bb1d03456a15294118a514271f3753ddfc8d Mon Sep 17 00:00:00 2001 From: dariusz-biela Date: Wed, 3 Sep 2025 13:41:15 +0200 Subject: [PATCH 1/3] refactor: replaces Onyx.connect with Onyx.connectWithoutView in src/libs/actions/App.ts for ONYXKEYS.IS_SIDEBAR_LOADED --- src/libs/actions/App.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/App.ts b/src/libs/actions/App.ts index a8fc974c3e79..7c967d13dba1 100644 --- a/src/libs/actions/App.ts +++ b/src/libs/actions/App.ts @@ -43,8 +43,11 @@ Onyx.connect({ }, }); +// isSidebarLoaded isn't used directly when rendering the View. It's used in the event handler. +// Using useOnyx would cause additional unnecessary rerenders that wouldn't change anything in the View, +// so I'm leaving Onyx.connectWithoutView here. let isSidebarLoaded: boolean | undefined; -Onyx.connect({ +Onyx.connectWithoutView({ key: ONYXKEYS.IS_SIDEBAR_LOADED, callback: (val) => (isSidebarLoaded = val), initWithStoredValues: false, From d1c5a7d1d59b7b45e97bbe4a1be9ad4628ec7763 Mon Sep 17 00:00:00 2001 From: dariusz-biela Date: Wed, 3 Sep 2025 13:41:38 +0200 Subject: [PATCH 2/3] chore: decrement number of max eslint warnings --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6def92653e6e..6007ef6bb7fa 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "test:debug": "TZ=utc NODE_OPTIONS='--inspect-brk --experimental-vm-modules' jest --runInBand", "perf-test": "NODE_OPTIONS=--experimental-vm-modules npx reassure", "typecheck": "NODE_OPTIONS=--max_old_space_size=8192 tsc", - "lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=216 --cache --cache-location=node_modules/.cache/eslint", + "lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=215 --cache --cache-location=node_modules/.cache/eslint", "lint-changed": "NODE_OPTIONS=--max_old_space_size=8192 ./scripts/lintChanged.sh", "lint-watch": "npx eslint-watch --watch --changed", "shellcheck": "./scripts/shellCheck.sh", From ef96b566cef875efcbdb67a431384f3dab053fbe Mon Sep 17 00:00:00 2001 From: dariusz-biela Date: Wed, 3 Sep 2025 15:07:21 +0200 Subject: [PATCH 3/3] refactor: shortens and improves the form of the comment for isSidebarLoaded --- src/libs/actions/App.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libs/actions/App.ts b/src/libs/actions/App.ts index 7c967d13dba1..2bf034773831 100644 --- a/src/libs/actions/App.ts +++ b/src/libs/actions/App.ts @@ -43,9 +43,8 @@ Onyx.connect({ }, }); -// isSidebarLoaded isn't used directly when rendering the View. It's used in the event handler. -// Using useOnyx would cause additional unnecessary rerenders that wouldn't change anything in the View, -// so I'm leaving Onyx.connectWithoutView here. +// `isSidebarLoaded` is only used inside the event handler, not during render. +// `useOnyx` would trigger extra rerenders without affecting the View, so `Onyx.connectWithoutView` is used instead let isSidebarLoaded: boolean | undefined; Onyx.connectWithoutView({ key: ONYXKEYS.IS_SIDEBAR_LOADED,