diff --git a/.eslintrc.js b/.eslintrc.js index 661a6aa286b9..77c7fafb7a02 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -108,7 +108,7 @@ module.exports = { 'plugin:you-dont-need-lodash-underscore/all', 'plugin:prettier/recommended', ], - plugins: ['@typescript-eslint', 'jsdoc', 'you-dont-need-lodash-underscore', 'react-native-a11y', 'react', 'testing-library', 'eslint-plugin-react-compiler'], + plugins: ['@typescript-eslint', 'jsdoc', 'you-dont-need-lodash-underscore', 'react-native-a11y', 'react', 'testing-library', 'eslint-plugin-react-compiler', 'lodash'], ignorePatterns: ['lib/**'], parser: '@typescript-eslint/parser', parserOptions: { @@ -231,6 +231,7 @@ module.exports = { 'you-dont-need-lodash-underscore/throttle': 'off', // The suggested alternative (structuredClone) is not supported in Hermes:https://github.com/facebook/hermes/issues/684 'you-dont-need-lodash-underscore/clone-deep': 'off', + 'lodash/import-scope': ['error', 'method'], 'prefer-regex-literals': 'off', 'valid-jsdoc': 'off', 'jsdoc/no-types': 'error', diff --git a/.github/libs/promiseWhile.ts b/.github/libs/promiseWhile.ts index 8bedceb894fd..bdd5713be43a 100644 --- a/.github/libs/promiseWhile.ts +++ b/.github/libs/promiseWhile.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line lodash/import-scope import type {DebouncedFunc} from 'lodash'; /** diff --git a/assets/animations/BankVault.lottie b/assets/animations/BankVault.lottie new file mode 100644 index 000000000000..82361e8e2209 Binary files /dev/null and b/assets/animations/BankVault.lottie differ diff --git a/assets/animations/GenericEmptyState.lottie b/assets/animations/GenericEmptyState.lottie new file mode 100644 index 000000000000..d62ff9d980bb Binary files /dev/null and b/assets/animations/GenericEmptyState.lottie differ diff --git a/assets/animations/TripsEmptyState.lottie b/assets/animations/TripsEmptyState.lottie new file mode 100644 index 000000000000..8a07a6ad10d5 Binary files /dev/null and b/assets/animations/TripsEmptyState.lottie differ diff --git a/contributingGuides/STYLE.md b/contributingGuides/STYLE.md index 6af3a82c2ff6..304811332916 100644 --- a/contributingGuides/STYLE.md +++ b/contributingGuides/STYLE.md @@ -50,6 +50,9 @@ - [Stateless components vs Pure Components vs Class based components vs Render Props](#stateless-components-vs-pure-components-vs-class-based-components-vs-render-props---when-to-use-what) - [Use Refs Appropriately](#use-refs-appropriately) - [Are we allowed to use [insert brand new React feature]?](#are-we-allowed-to-use-insert-brand-new-react-feature-why-or-why-not) +- [Handling Scroll Issues with Nested Lists in React Native](#handling-scroll-issues-with-nested-lists-in-react-native) + - [Wrong Approach (Using SelectionList)](#wrong-approach-using-selectionlist) + - [Correct Approach (Using SelectionList)](#correct-approach-using-selectionlist) - [React Hooks: Frequently Asked Questions](#react-hooks-frequently-asked-questions) - [Onyx Best Practices](#onyx-best-practices) - [Collection Keys](#collection-keys) @@ -1105,6 +1108,48 @@ There are several ways to use and declare refs and we prefer the [callback metho We love React and learning about all the new features that are regularly being added to the API. However, we try to keep our organization's usage of React limited to the most stable set of features that React offers. We do this mainly for **consistency** and so our engineers don't have to spend extra time trying to figure out how everything is working. That said, if you aren't sure if we have adopted something, please ask us first. + +## Handling Scroll Issues with Nested Lists in React Native + +### Problem + +When using `SelectionList` alongside other components (e.g., `Text`, `Button`), wrapping them inside a `ScrollView` can lead to alignment and performance issues. Additionally, using `ScrollView` with nested `FlatList` or `SectionList` causes the error: + +> "VirtualizedLists should never be nested inside plain ScrollViews with the same orientation." + +### Solution + +The correct approach is avoid using `ScrollView`. You can add props like `listHeaderComponent` and `listFooterComponent` to add other components before or after the list while keeping the layout scrollable. + +### Wrong Approach (Using `SelectionList`) + +```jsx + + Header Content + +