From 809c9c88cab544d67bbff20d9979a3a2c45d0446 Mon Sep 17 00:00:00 2001 From: dariusz-biela Date: Wed, 3 Sep 2025 12:21:04 +0200 Subject: [PATCH 1/3] refactor: replaces Onyx.connect with Onyx.connectWithoutView in src/libs/actions/App.ts for ONYXKEYS.IS_USING_IMPORTED_STATE --- 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..cac6ed8b2279 100644 --- a/src/libs/actions/App.ts +++ b/src/libs/actions/App.ts @@ -50,8 +50,11 @@ Onyx.connect({ initWithStoredValues: false, }); +// isUsingImportedState is used in the "clearOnyxAndResetApp" function and is not directly associated with the View, +// so retrieving it using Onyx.connectWithoutView is correct. +// If this variable is ever needed for use in React components, it should be retrieved using useOnyx. let isUsingImportedState: boolean | undefined; -Onyx.connect({ +Onyx.connectWithoutView({ key: ONYXKEYS.IS_USING_IMPORTED_STATE, callback: (value) => { isUsingImportedState = value ?? false; From 98862f6cd08a4cd25910558f994a5b49ce2d2a30 Mon Sep 17 00:00:00 2001 From: dariusz-biela Date: Wed, 3 Sep 2025 12:21:36 +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 7a3810e3286d5939b45da94b25d5445be497185f Mon Sep 17 00:00:00 2001 From: dariusz-biela Date: Wed, 3 Sep 2025 15:11:08 +0200 Subject: [PATCH 3/3] refactor: shortens and improves the form of the comment for isUsingImportedState --- 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 cac6ed8b2279..8e56c81110b8 100644 --- a/src/libs/actions/App.ts +++ b/src/libs/actions/App.ts @@ -50,9 +50,8 @@ Onyx.connect({ initWithStoredValues: false, }); -// isUsingImportedState is used in the "clearOnyxAndResetApp" function and is not directly associated with the View, -// so retrieving it using Onyx.connectWithoutView is correct. -// If this variable is ever needed for use in React components, it should be retrieved using useOnyx. +// `isUsingImportedState` is only used in `clearOnyxAndResetApp`, not during render. So `Onyx.connectWithoutView` is appropriate. +// If React components need this value in the future, use `useOnyx` instead. let isUsingImportedState: boolean | undefined; Onyx.connectWithoutView({ key: ONYXKEYS.IS_USING_IMPORTED_STATE,