From ddea7c76b38321e192a29ddf11d794de2796a1d2 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Mon, 4 May 2020 00:57:01 -0700 Subject: [PATCH] VirtualizedList: Remove `PropTypes` Dependency 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 --- Libraries/Lists/VirtualizedList.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index bf65fbdd10..36e5f36406 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -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'); @@ -1786,19 +1785,6 @@ class VirtualizedList extends React.PureComponent { 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