Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Libraries/Lists/VirtualizedList.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

const Batchinator = require('Batchinator');
const FillRateHelper = require('FillRateHelper');
const PropTypes = require('prop-types');
const React = require('React');
const ReactNative = require('ReactNative');
const RefreshControl = require('RefreshControl');
Expand Down Expand Up @@ -841,6 +842,19 @@ class VirtualizedList extends React.PureComponent<OptionalProps, 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'
);
}
}
}
return frame;
Expand Down