Skip to content

Commit

Permalink
Move VirtualizedList_EXPERIMENTAL to ES6 import/export
Browse files Browse the repository at this point in the history
Summary:
VirtualizedList uses a combination of ES6 and CommonJS imports/exports. This moves fully to ES6 imports and exports, in the experimental version (which should soon replace the original).

Changelog:
[Internal][Changed] - Move VirtualizedList_EXPERIMENTAL to ES6 import/export

Reviewed By: rshest

Differential Revision: D39648806

fbshipit-source-id: a5da40f62a6010cd5b9894b02a91af86d3a8b995
  • Loading branch information
NickGerleman authored and facebook-github-bot committed Sep 20, 2022
1 parent 8f0975a commit a0d1585
Showing 1 changed file with 27 additions and 26 deletions.
53 changes: 27 additions & 26 deletions Libraries/Lists/VirtualizedList_EXPERIMENTAL.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,34 @@ import type {

export type {RenderItemProps, RenderItemType, Separators};

import {
VirtualizedListCellContextProvider,
VirtualizedListContext,
VirtualizedListContextProvider,
} from './VirtualizedListContext.js';
import {
computeWindowedRenderLimits,
keyExtractor as defaultKeyExtractor,
} from './VirtualizeUtils';
import * as React from 'react';
import invariant from 'invariant';

import RefreshControl from '../Components/RefreshControl/RefreshControl';
import ScrollView from '../Components/ScrollView/ScrollView';
import View from '../Components/View/View';
import Batchinator from '../Interaction/Batchinator';
import {findNodeHandle} from '../ReactNative/RendererProxy';
import flattenStyle from '../StyleSheet/flattenStyle';
import StyleSheet from '../StyleSheet/StyleSheet';
import clamp from '../Utilities/clamp';
import infoLog from '../Utilities/infoLog';

import {CellRenderMask} from './CellRenderMask';
import ChildListCollection from './ChildListCollection';
import clamp from '../Utilities/clamp';
import StateSafePureComponent from './StateSafePureComponent';
import FillRateHelper from './FillRateHelper';
import ViewabilityHelper from './ViewabilityHelper';
import {
computeWindowedRenderLimits,
keyExtractor as defaultKeyExtractor,
} from './VirtualizeUtils';
import CellRenderer from './VirtualizedListCellRenderer';

const RefreshControl = require('../Components/RefreshControl/RefreshControl');
const ScrollView = require('../Components/ScrollView/ScrollView');
const View = require('../Components/View/View');
const Batchinator = require('../Interaction/Batchinator');
const {findNodeHandle} = require('../ReactNative/RendererProxy');
const flattenStyle = require('../StyleSheet/flattenStyle');
const StyleSheet = require('../StyleSheet/StyleSheet');
const infoLog = require('../Utilities/infoLog');
const FillRateHelper = require('./FillRateHelper');
const ViewabilityHelper = require('./ViewabilityHelper');
const invariant = require('invariant');
import {
VirtualizedListCellContextProvider,
VirtualizedListContext,
VirtualizedListContextProvider,
} from './VirtualizedListContext.js';

const ON_END_REACHED_EPSILON = 0.001;

Expand Down Expand Up @@ -150,8 +150,12 @@ function findLastWhere<T>(
* - As an effort to remove defaultProps, use helper functions when referencing certain props
*
*/
class VirtualizedList extends StateSafePureComponent<Props, State> {
export default class VirtualizedList extends StateSafePureComponent<
Props,
State,
> {
static contextType: typeof VirtualizedListContext = VirtualizedListContext;
displayName: 'VirtualizedList_EXPERIMENTAL';

// scrollToEnd may be janky without getItemLayout prop
scrollToEnd(params?: ?{animated?: ?boolean, ...}) {
Expand Down Expand Up @@ -1876,6 +1880,3 @@ const styles = StyleSheet.create({
borderWidth: 2,
},
});

VirtualizedList.displayName = 'VirtualizedList_EXPERIMENTAL';
module.exports = VirtualizedList;

0 comments on commit a0d1585

Please sign in to comment.