From a39f91b5b629e077eaf997d71b2130cfb712ff49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Fri, 31 Jul 2026 08:56:52 -0700 Subject: [PATCH 1/5] Use newest Onyx changes --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 965034391f02..ccc3e9039549 100644 --- a/package-lock.json +++ b/package-lock.json @@ -124,7 +124,7 @@ "react-native-nitro-fetch": "1.5.4", "react-native-nitro-modules": "0.36.3", "react-native-nitro-sqlite": "9.6.0", - "react-native-onyx": "3.0.90", + "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#05cb035cecac500befb8acb72c9c78bb462a7f26", "react-native-pager-view": "8.0.0", "react-native-pdf": "7.0.2", "react-native-permissions": "^5.4.0", @@ -36046,9 +36046,9 @@ } }, "node_modules/react-native-onyx": { - "version": "3.0.90", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-3.0.90.tgz", - "integrity": "sha512-rbmmCJzzwt17NS/vfXQFmiljTI5rmYFnX1tWV3q4ZkwzX/gtB7HXTd9b7mS2m2dNBoWJxWz0eLHwUiPd9bLiCQ==", + "version": "3.0.94", + "resolved": "git+ssh://git@github.com/Expensify/react-native-onyx.git#05cb035cecac500befb8acb72c9c78bb462a7f26", + "integrity": "sha512-rOQH6rjFfkk0ajVpLFE7AZVRW7LHHkE4qMVpoQqR8/HuM3iR170WvtMx0Z1IlEw9ff6y5NvAJHJUKI7L/upSrQ==", "license": "MIT", "dependencies": { "ascii-table": "0.0.9", diff --git a/package.json b/package.json index d5a956887385..330646efd20e 100644 --- a/package.json +++ b/package.json @@ -198,7 +198,7 @@ "react-native-nitro-fetch": "1.5.4", "react-native-nitro-modules": "0.36.3", "react-native-nitro-sqlite": "9.6.0", - "react-native-onyx": "3.0.90", + "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#05cb035cecac500befb8acb72c9c78bb462a7f26", "react-native-pager-view": "8.0.0", "react-native-pdf": "7.0.2", "react-native-permissions": "^5.4.0", From 4d71dbc90a8b02e92cd6d008bba44f767dedbb15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Fri, 31 Jul 2026 09:25:42 -0700 Subject: [PATCH 2/5] Remove remaining dependencies array usage --- .../useReportPreviewActionDecision.ts | 2 +- src/hooks/useOnyx.ts | 5 ++--- src/hooks/useReportTransactionViolations.ts | 14 +++----------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/components/ReportActionItem/MoneyRequestReportPreview/useReportPreviewActionDecision.ts b/src/components/ReportActionItem/MoneyRequestReportPreview/useReportPreviewActionDecision.ts index 6a4c74bb69db..757f55c6811c 100644 --- a/src/components/ReportActionItem/MoneyRequestReportPreview/useReportPreviewActionDecision.ts +++ b/src/components/ReportActionItem/MoneyRequestReportPreview/useReportPreviewActionDecision.ts @@ -47,7 +47,7 @@ function useReportPreviewActionDecision({ const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${iouReport?.policyID}`); const [bankAccountList] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST); const [iouReportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${iouReportID}`); - const [ownerLogin] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: personalDetailsLoginSelector(iouReport?.ownerAccountID)}, [iouReport?.ownerAccountID]); + const [ownerLogin] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: personalDetailsLoginSelector(iouReport?.ownerAccountID)}); const isDEWPolicy = hasDynamicExternalWorkflow(policy); const isDEWSubmitPending = hasPendingDEWSubmit(iouReportMetadata, isDEWPolicy); diff --git a/src/hooks/useOnyx.ts b/src/hooks/useOnyx.ts index ea04ec1a7d38..a90ef1c286c8 100644 --- a/src/hooks/useOnyx.ts +++ b/src/hooks/useOnyx.ts @@ -5,7 +5,6 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import type {SearchResults} from '@src/types/onyx'; -import type {DependencyList} from 'react'; import type {OnyxCollection, OnyxEntry, OnyxKey, OnyxValue, UseOnyxOptions, UseOnyxResult} from 'react-native-onyx'; import {use} from 'react'; @@ -73,7 +72,7 @@ function resolveSnapshotAwareResult( /** * Custom hook for accessing and subscribing to Onyx data with search snapshot support */ -const useOnyx: OriginalUseOnyx = >(key: TKey, options?: UseOnyxOptions, dependencies?: DependencyList) => { +const useOnyx: OriginalUseOnyx = >(key: TKey, options?: UseOnyxOptions) => { const isSnapshotCompatibleKey = !key.startsWith(ONYXKEYS.COLLECTION.SNAPSHOT) && CONST.SEARCH.SNAPSHOT_ONYX_KEYS.some((snapshotKey) => key.startsWith(snapshotKey)); const isOnSearch = useIsOnSearch(); @@ -98,7 +97,7 @@ const useOnyx: OriginalUseOnyx = > = {...optionsWithoutSelector, selector}; const snapshotKey = shouldUseSnapshot ? (`${ONYXKEYS.COLLECTION.SNAPSHOT}${currentSearchHash}` as OnyxKey) : key; - const originalResult = originalUseOnyx(snapshotKey, onyxOptions, dependencies); + const originalResult = originalUseOnyx(snapshotKey, onyxOptions); // Extract the specific key data from snapshot if in search mode const result = resolveSnapshotAwareResult(shouldUseSnapshot, !!selector, originalResult, key); diff --git a/src/hooks/useReportTransactionViolations.ts b/src/hooks/useReportTransactionViolations.ts index 71bcdc461fa5..77d4b407dc6d 100644 --- a/src/hooks/useReportTransactionViolations.ts +++ b/src/hooks/useReportTransactionViolations.ts @@ -1,10 +1,8 @@ import ONYXKEYS from '@src/ONYXKEYS'; import {transactionViolationsByIDsSelector} from '@src/selectors/TransactionViolations'; -import type {Transaction, TransactionViolations} from '@src/types/onyx'; +import type {Transaction} from '@src/types/onyx'; -import type {OnyxCollection} from 'react-native-onyx'; - -import {useCallback, useMemo} from 'react'; +import {useMemo} from 'react'; import useOnyx from './useOnyx'; @@ -14,13 +12,7 @@ import useOnyx from './useOnyx'; */ function useReportTransactionViolations(transactions: Transaction[]) { const transactionIDs = useMemo(() => transactions.map((transaction) => transaction.transactionID), [transactions]); - const selectTransactionViolations = useCallback( - (allViolations: OnyxCollection) => transactionViolationsByIDsSelector(transactionIDs)(allViolations), - [transactionIDs], - ); - // Pass `transactionIDs` as a dependency so the selector re-runs once the transactions hydrate (otherwise - // it stays closed over the initial empty list and violations would never be selected on first load). - return useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {selector: selectTransactionViolations}, [transactionIDs]); + return useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {selector: transactionViolationsByIDsSelector(transactionIDs)}); } export default useReportTransactionViolations; From 07eab475576ac08ba99d9d262d5e0fec73257268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Fri, 31 Jul 2026 09:34:13 -0700 Subject: [PATCH 3/5] Remove no-useOnyx-dependencies-arg ESLint rule --- config/eslint/eslint.config.mjs | 1 - config/eslint/eslint.seatbelt.tsv | 4 -- .../no-useOnyx-dependencies-arg.js | 46 ------------------- 3 files changed, 51 deletions(-) delete mode 100644 eslint-plugin-local-rules/no-useOnyx-dependencies-arg.js diff --git a/config/eslint/eslint.config.mjs b/config/eslint/eslint.config.mjs index 34f5bf850b83..519dc876d090 100644 --- a/config/eslint/eslint.config.mjs +++ b/config/eslint/eslint.config.mjs @@ -335,7 +335,6 @@ const config = defineConfig([ 'rulesdir/require-live-region-for-status-updates': 'error', 'rulesdir/require-a11y-disable-justification': 'error', 'rulesdir/no-direct-pre-insert-fullscreen-under-rhp': 'error', - 'rulesdir/no-useOnyx-dependencies-arg': 'error', 'rulesdir/prefer-narrow-hook-dependencies': [ 'error', { diff --git a/config/eslint/eslint.seatbelt.tsv b/config/eslint/eslint.seatbelt.tsv index 7fb85e241b7e..56c23784c1a1 100644 --- a/config/eslint/eslint.seatbelt.tsv +++ b/config/eslint/eslint.seatbelt.tsv @@ -328,7 +328,6 @@ "../../src/components/ReportActionItem/MoneyReportView.tsx" "@typescript-eslint/no-unsafe-type-assertion" 2 "../../src/components/ReportActionItem/MoneyRequestReceiptView.tsx" "@typescript-eslint/no-unsafe-type-assertion" 2 "../../src/components/ReportActionItem/MoneyRequestReceiptView.tsx" "react-hooks/set-state-in-effect" 1 -"../../src/components/ReportActionItem/MoneyRequestReportPreview/useReportPreviewActionDecision.ts" "rulesdir/no-useOnyx-dependencies-arg" 1 "../../src/components/ReportActionItem/MoneyRequestView.tsx" "@typescript-eslint/no-deprecated/deprecatedGetReportName" 2 "../../src/components/ReportActionItem/TaskPreview.tsx" "@typescript-eslint/no-unsafe-type-assertion" 1 "../../src/components/ReportActionItem/TaskView.tsx" "@typescript-eslint/no-unsafe-type-assertion" 1 @@ -562,7 +561,6 @@ "../../src/hooks/usePrevious.ts" "react-hooks/refs" 1 "../../src/hooks/useReceiptScanDrop.tsx" "@typescript-eslint/no-unsafe-type-assertion" 3 "../../src/hooks/useReportScrollManager/index.native.ts" "@typescript-eslint/no-unsafe-type-assertion" 1 -"../../src/hooks/useReportTransactionViolations.ts" "rulesdir/no-useOnyx-dependencies-arg" 1 "../../src/hooks/useResetBankAccountModal.tsx" "@typescript-eslint/no-unsafe-type-assertion" 1 "../../src/hooks/useResponsiveLayout/index.native.ts" "@typescript-eslint/no-unsafe-type-assertion" 1 "../../src/hooks/useResponsiveLayout/index.ts" "@typescript-eslint/no-unsafe-type-assertion" 1 @@ -1343,7 +1341,6 @@ "../../src/pages/settings/Wallet/ExpensifyCardPage/ChangePINPage.tsx" "no-restricted-imports" 1 "../../src/pages/settings/Wallet/ExpensifyCardPage/index.tsx" "@typescript-eslint/no-deprecated/ConfirmModal" 2 "../../src/pages/settings/Wallet/ExpensifyCardPage/index.tsx" "no-restricted-imports" 1 -"../../src/pages/settings/Wallet/ExpensifyCardPage/index.tsx" "rulesdir/no-useOnyx-dependencies-arg" 1 "../../src/pages/settings/Wallet/InternationalDepositAccount/PersonalInfo/PersonalInfo.tsx" "@typescript-eslint/no-deprecated/useSubStep" 1 "../../src/pages/settings/Wallet/InternationalDepositAccount/PersonalInfo/substeps/AddressStep.tsx" "@typescript-eslint/no-unsafe-type-assertion" 6 "../../src/pages/settings/Wallet/InternationalDepositAccount/PersonalInfo/substeps/AddressStep.tsx" "react-hooks/set-state-in-effect" 1 @@ -1376,7 +1373,6 @@ "../../src/pages/signin/SignUpWelcomeForm.tsx" "no-restricted-imports" 1 "../../src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.tsx" "no-restricted-imports" 1 "../../src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.tsx" "react-hooks/set-state-in-effect" 4 -"../../src/pages/tasks/DynamicNewTaskDetailsPage.tsx" "rulesdir/no-useOnyx-dependencies-arg" 1 "../../src/pages/tasks/DynamicTaskShareDestinationSelectorModal.tsx" "@typescript-eslint/no-unsafe-type-assertion" 2 "../../src/pages/wallet/WalletStatementPage.tsx" "@typescript-eslint/no-unsafe-type-assertion" 1 "../../src/pages/workspace/DynamicWorkspaceConfirmationPage.tsx" "@typescript-eslint/no-unsafe-type-assertion" 2 diff --git a/eslint-plugin-local-rules/no-useOnyx-dependencies-arg.js b/eslint-plugin-local-rules/no-useOnyx-dependencies-arg.js deleted file mode 100644 index d83e1e997172..000000000000 --- a/eslint-plugin-local-rules/no-useOnyx-dependencies-arg.js +++ /dev/null @@ -1,46 +0,0 @@ -const name = 'no-useOnyx-dependencies-arg'; - -const meta = { - type: 'problem', - docs: { - description: 'Disallow the deprecated 3rd `dependencies` argument of useOnyx(). React Compiler memoizes selectors; keep the selector reference stable instead.', - recommended: 'error', - }, - schema: [], - messages: { - noDependenciesArg: - 'The 3rd `dependencies` argument of useOnyx() is deprecated and being removed (https://github.com/Expensify/App/issues/94595).\n\n' + - 'Do not pass a dependency array. Keep the selector reference stable instead:\n' + - '- Prefer an inline or module-level selector (React Compiler memoizes it automatically).\n' + - '- In React-Compiler-bailout files, wrap the selector in useCallback with the relevant dependencies.', - }, -}; - -/** - * Flags any `useOnyx(key, options, dependencies)` call that still passes the deprecated - * 3rd `dependencies` argument. Matches the `useOnyx` identifier regardless of import source - * (both `@hooks/useOnyx` and the restricted `react-native-onyx` import). - * - * @param {import('eslint').Rule.RuleContext} context - * @returns {import('eslint').Rule.RuleListener} - */ -function create(context) { - return { - CallExpression(node) { - if (node.callee.type !== 'Identifier' || node.callee.name !== 'useOnyx') { - return; - } - - if (node.arguments.length < 3) { - return; - } - - context.report({ - node: node.arguments[2], - messageId: 'noDependenciesArg', - }); - }, - }; -} - -export {name, meta, create}; From 43df59c77a223aa04935db645adb3aa316d87755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Fri, 7 Aug 2026 15:23:21 +0100 Subject: [PATCH 4/5] Bump Onyx to 3.0.96 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 52103730c453..f335cdd358b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -124,7 +124,7 @@ "react-native-nitro-fetch": "1.5.4", "react-native-nitro-modules": "0.36.3", "react-native-nitro-sqlite": "9.6.0", - "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#05cb035cecac500befb8acb72c9c78bb462a7f26", + "react-native-onyx": "3.0.96", "react-native-pager-view": "8.0.0", "react-native-pdf": "7.0.2", "react-native-permissions": "^5.4.0", @@ -36071,9 +36071,9 @@ } }, "node_modules/react-native-onyx": { - "version": "3.0.94", - "resolved": "git+ssh://git@github.com/Expensify/react-native-onyx.git#05cb035cecac500befb8acb72c9c78bb462a7f26", - "integrity": "sha512-rOQH6rjFfkk0ajVpLFE7AZVRW7LHHkE4qMVpoQqR8/HuM3iR170WvtMx0Z1IlEw9ff6y5NvAJHJUKI7L/upSrQ==", + "version": "3.0.96", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-3.0.96.tgz", + "integrity": "sha512-UFeBg8gmo1IuaBPJBd1zmSBnvMCTCSmMtVfg6ZFvCLiAOgxoWayng3PLjo0yck3JyIg0wTAGkvAEIRvSrFxnxQ==", "license": "MIT", "dependencies": { "ascii-table": "0.0.9", diff --git a/package.json b/package.json index 0e96f02ad9e0..3d05f9b4352f 100644 --- a/package.json +++ b/package.json @@ -198,7 +198,7 @@ "react-native-nitro-fetch": "1.5.4", "react-native-nitro-modules": "0.36.3", "react-native-nitro-sqlite": "9.6.0", - "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#05cb035cecac500befb8acb72c9c78bb462a7f26", + "react-native-onyx": "3.0.96", "react-native-pager-view": "8.0.0", "react-native-pdf": "7.0.2", "react-native-permissions": "^5.4.0", From 522371a6707864e6e6c5f98cdced3b459c641e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Fri, 7 Aug 2026 21:50:25 +0100 Subject: [PATCH 5/5] Rollback Onyx to 3.0.95 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index f335cdd358b9..aff8df7c17de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -124,7 +124,7 @@ "react-native-nitro-fetch": "1.5.4", "react-native-nitro-modules": "0.36.3", "react-native-nitro-sqlite": "9.6.0", - "react-native-onyx": "3.0.96", + "react-native-onyx": "3.0.95", "react-native-pager-view": "8.0.0", "react-native-pdf": "7.0.2", "react-native-permissions": "^5.4.0", @@ -36071,9 +36071,9 @@ } }, "node_modules/react-native-onyx": { - "version": "3.0.96", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-3.0.96.tgz", - "integrity": "sha512-UFeBg8gmo1IuaBPJBd1zmSBnvMCTCSmMtVfg6ZFvCLiAOgxoWayng3PLjo0yck3JyIg0wTAGkvAEIRvSrFxnxQ==", + "version": "3.0.95", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-3.0.95.tgz", + "integrity": "sha512-NlavsqmiuuqOXR/QYbFRs5Fi3tSzgBgD5XRN26B6sjNcqy8OcJRIyFa/J098rPke1QM0LIfz9CzvQ5YMi9GMWA==", "license": "MIT", "dependencies": { "ascii-table": "0.0.9", diff --git a/package.json b/package.json index 3d05f9b4352f..9a9edec2ebe0 100644 --- a/package.json +++ b/package.json @@ -198,7 +198,7 @@ "react-native-nitro-fetch": "1.5.4", "react-native-nitro-modules": "0.36.3", "react-native-nitro-sqlite": "9.6.0", - "react-native-onyx": "3.0.96", + "react-native-onyx": "3.0.95", "react-native-pager-view": "8.0.0", "react-native-pdf": "7.0.2", "react-native-permissions": "^5.4.0",