mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Move VirtualizedList_EXPERIMENTAL to ES6 import/export
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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8f0975a3b7
commit
a0d1585cdb
@@ -24,34 +24,34 @@ import type {
|
||||
|
||||
export type {RenderItemProps, RenderItemType, Separators};
|
||||
|
||||
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 StateSafePureComponent from './StateSafePureComponent';
|
||||
import FillRateHelper from './FillRateHelper';
|
||||
import ViewabilityHelper from './ViewabilityHelper';
|
||||
import {
|
||||
computeWindowedRenderLimits,
|
||||
keyExtractor as defaultKeyExtractor,
|
||||
} from './VirtualizeUtils';
|
||||
import CellRenderer from './VirtualizedListCellRenderer';
|
||||
import {
|
||||
VirtualizedListCellContextProvider,
|
||||
VirtualizedListContext,
|
||||
VirtualizedListContextProvider,
|
||||
} from './VirtualizedListContext.js';
|
||||
import {
|
||||
computeWindowedRenderLimits,
|
||||
keyExtractor as defaultKeyExtractor,
|
||||
} from './VirtualizeUtils';
|
||||
import * as React from 'react';
|
||||
|
||||
import {CellRenderMask} from './CellRenderMask';
|
||||
import ChildListCollection from './ChildListCollection';
|
||||
import clamp from '../Utilities/clamp';
|
||||
import StateSafePureComponent from './StateSafePureComponent';
|
||||
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');
|
||||
|
||||
const ON_END_REACHED_EPSILON = 0.001;
|
||||
|
||||
@@ -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, ...}) {
|
||||
@@ -1876,6 +1880,3 @@ const styles = StyleSheet.create({
|
||||
borderWidth: 2,
|
||||
},
|
||||
});
|
||||
|
||||
VirtualizedList.displayName = 'VirtualizedList_EXPERIMENTAL';
|
||||
module.exports = VirtualizedList;
|
||||
|
||||
Reference in New Issue
Block a user