Parent
This is a child of #70272
Background
Inline selectors passed to useOnyx break memoization by creating a new function identity every render, causing unnecessary recomputations and re-renders. We’re standardizing selectors as first-class citizens to unlock recent useOnyx memoization improvements.
Goal
Refactor all inline selectors in this scope to one of:
- Shared selector: lives in
src/libs/onyx/selectors/<domain>/... when reused across components.
- Local selector: defined outside the component (same file) if only used by that file.
- Contextual selector: created with
useCallback (inside the component) only when it needs component data; dependency array must include that data.
Example implementation for the Session keys: #70264
Keys to handle
- User wallet -
ONYXKEYS.USER_WALLET — 6
- Report -
ONYXKEYS.COLLECTION.REPORT — 5
- Policy categories -
ONYXKEYS.COLLECTION.POLICY_CATEGORIES — 2
- Exit survey reason -
ONYXKEYS.FORMS.EXIT_SURVEY_REASON — 2
- Exit survey reason draft -
ONYXKEYS.FORMS.EXIT_SURVEY_REASON_FORM_DRAFT — 2
- Personal bank account -
ONYXKEYS.PERSONAL_BANK_ACCOUNT — 1
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021968348772489505781
- Upwork Job ID: 1968348772489505781
- Last Price Increase: 2025-09-17
- Automatic offers:
- LorenzoBloedow | Contributor | 108817045
Issue Owner
Current Issue Owner: @
Issue Owner
Current Issue Owner: @
Issue Owner
Current Issue Owner: @mallenexpensify
Parent
This is a child of #70272
Background
Inline selectors passed to useOnyx break memoization by creating a new function identity every render, causing unnecessary recomputations and re-renders. We’re standardizing selectors as first-class citizens to unlock recent useOnyx memoization improvements.
Goal
Refactor all inline selectors in this scope to one of:
src/libs/onyx/selectors/<domain>/...when reused across components.useCallback(inside the component) only when it needs component data; dependency array must include that data.Example implementation for the Session keys: #70264
Keys to handle
ONYXKEYS.USER_WALLET— 6ONYXKEYS.COLLECTION.REPORT— 5ONYXKEYS.COLLECTION.POLICY_CATEGORIES— 2ONYXKEYS.FORMS.EXIT_SURVEY_REASON— 2ONYXKEYS.FORMS.EXIT_SURVEY_REASON_FORM_DRAFT— 2ONYXKEYS.PERSONAL_BANK_ACCOUNT— 1Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @Issue Owner
Current Issue Owner: @Issue Owner
Current Issue Owner: @mallenexpensify