// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import React from 'react'; import {SectionList} from 'react-native'; import MetroListView from 'react-native/Libraries/Lists/MetroListView'; import VirtualizedSectionList from './virtualized_section_list'; export default class ScrollableSectionList extends SectionList { getWrapperRef = () => { return this._wrapperListRef; //eslint-disable-line no-underscore-dangle }; render() { const List = this.props.legacyImplementation ? MetroListView : VirtualizedSectionList; return ( ); } _wrapperListRef: MetroListView | VirtualizedSectionList; //eslint-disable-line no-underscore-dangle _captureRef = (ref) => { this._wrapperListRef = ref; //eslint-disable-line no-underscore-dangle }; }