Skip to content

Commit

Permalink
use renderScrollComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
perunt authored and janicduplessis committed Oct 20, 2023
1 parent 3cc63f8 commit d82cf20
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/InvertedFlatList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, {forwardRef, useEffect, useRef} from 'react';
import PropTypes from 'prop-types';
import {DeviceEventEmitter, FlatList, StyleSheet} from 'react-native';
import _ from 'underscore';
import MVCPScrollView from './MVCPScrollView/MVCPScrollView';
import BaseInvertedFlatList from './BaseInvertedFlatList';
import styles from '../../styles/styles';
import CONST from '../../CONST';
Expand Down Expand Up @@ -121,6 +122,10 @@ function InvertedFlatList(props) {
// We need to keep batch size to one to workaround a bug in react-native-web.
// This can be removed once https://github.com/Expensify/App/pull/24482 is merged.
maxToRenderPerBatch={1}

// We need to use our own scroll component to workaround a maintainVisibleContentPosition for web
// eslint-disable-next-line react/jsx-props-no-spreading
renderScrollComponent={(_props) => <MVCPScrollView {..._props} />}
/>
);
}
Expand Down

0 comments on commit d82cf20

Please sign in to comment.