Skip to content

Commit

Permalink
VirtualizedList: Remove PropTypes Dependency
Browse files Browse the repository at this point in the history
Summary:
Removes `PropTypes` as a dependency of `VirtualizedList` by no longer validating the return value of `getItemLayout`.

Changelog: [Internal]

Reviewed By: TheSavior, cpojer

Differential Revision: D21370890

fbshipit-source-id: 966db3557b714987aa91179c7654a5ebf27818ad
  • Loading branch information
yungsters authored and facebook-github-bot committed May 4, 2020
1 parent 7bd694f commit ddea7c7
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions Libraries/Lists/VirtualizedList.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

const Batchinator = require('../Interaction/Batchinator');
const FillRateHelper = require('./FillRateHelper');
const PropTypes = require('prop-types');
const ReactNative = require('../Renderer/shims/ReactNative');
const RefreshControl = require('../Components/RefreshControl/RefreshControl');
const ScrollView = require('../Components/ScrollView/ScrollView');
Expand Down Expand Up @@ -1786,19 +1785,6 @@ class VirtualizedList extends React.PureComponent<Props, State> {
if (!frame || frame.index !== index) {
if (getItemLayout) {
frame = getItemLayout(data, index);
if (__DEV__) {
const frameType = PropTypes.shape({
length: PropTypes.number.isRequired,
offset: PropTypes.number.isRequired,
index: PropTypes.number.isRequired,
}).isRequired;
PropTypes.checkPropTypes(
{frame: frameType},
{frame},
'frame',
'VirtualizedList.getItemLayout',
);
}
}
}
/* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an
Expand Down

0 comments on commit ddea7c7

Please sign in to comment.