diff --git a/Libraries/Lists/SectionList.js b/Libraries/Lists/SectionList.js index 35a5e3506..cf5cbbb41 100644 --- a/Libraries/Lists/SectionList.js +++ b/Libraries/Lists/SectionList.js @@ -252,7 +252,10 @@ type DefaultProps = typeof defaultProps; * Alternatively, you can provide a custom `keyExtractor` prop. * */ -class SectionList> extends React.PureComponent, void> { +class SectionList> extends React.PureComponent< + Props, + void, +> { props: Props; static defaultProps: DefaultProps = defaultProps; diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index 569520736..3d1d8cea2 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -1221,23 +1221,26 @@ class VirtualizedList extends React.PureComponent { } } -class CellRenderer extends React.Component<{ - CellRendererComponent?: ?React.ComponentType, - ItemSeparatorComponent: ?React.ComponentType<*>, - cellKey: string, - fillRateHelper: FillRateHelper, - index: number, - inversionStyle: ?StyleObj, - item: Item, - onLayout: (event: Object) => void, // This is extracted by ScrollViewStickyHeader - onUnmount: (cellKey: string) => void, - onUpdateSeparators: (cellKeys: Array, props: Object) => void, - parentProps: { - getItemLayout?: ?Function, - renderItem: renderItemType, +class CellRenderer extends React.Component< + { + CellRendererComponent?: ?React.ComponentType, + ItemSeparatorComponent: ?React.ComponentType<*>, + cellKey: string, + fillRateHelper: FillRateHelper, + index: number, + inversionStyle: ?StyleObj, + item: Item, + onLayout: (event: Object) => void, // This is extracted by ScrollViewStickyHeader + onUnmount: (cellKey: string) => void, + onUpdateSeparators: (cellKeys: Array, props: Object) => void, + parentProps: { + getItemLayout?: ?Function, + renderItem: renderItemType, + }, + prevCellKey: ?string, }, - prevCellKey: ?string, -}, $FlowFixMeState> { + $FlowFixMeState, +> { state = { separatorProps: { highlighted: false, diff --git a/Libraries/Lists/VirtualizedSectionList.js b/Libraries/Lists/VirtualizedSectionList.js index fbb231f07..e4ab9883b 100644 --- a/Libraries/Lists/VirtualizedSectionList.js +++ b/Libraries/Lists/VirtualizedSectionList.js @@ -133,7 +133,10 @@ type State = {childProps: VirtualizedListProps}; * hood. The only operation that might not scale well is concatting the data arrays of all the * sections when new props are received, which should be plenty fast for up to ~10,000 items. */ -class VirtualizedSectionList extends React.PureComponent, State> { +class VirtualizedSectionList extends React.PureComponent< + Props, + State, +> { props: Props; state: State; @@ -301,7 +304,10 @@ class VirtualizedSectionList extends React.PureComponent< ref && ref.updateSeparatorProps(newProps); }; - _getSeparatorComponent(index: number, info?: ?Object): ?React.ComponentType<*> { + _getSeparatorComponent( + index: number, + info?: ?Object, + ): ?React.ComponentType<*> { info = info || this._subExtractor(index); if (!info) { return null; @@ -389,7 +395,10 @@ type ItemWithSeparatorProps = { trailingSection: ?Object, }; -class ItemWithSeparator extends React.Component { +class ItemWithSeparator extends React.Component< + ItemWithSeparatorProps, + $FlowFixMeState, +> { state = { separatorProps: { highlighted: false, diff --git a/RNTester/js/CameraRollExample.js b/RNTester/js/CameraRollExample.js index 2cec3f3bd..00f053698 100644 --- a/RNTester/js/CameraRollExample.js +++ b/RNTester/js/CameraRollExample.js @@ -31,7 +31,10 @@ const CameraRollView = require('./CameraRollView'); const AssetScaledImageExampleView = require('./AssetScaledImageExample'); -class CameraRollExample extends React.Component<$FlowFixMeProps, $FlowFixMeState> { +class CameraRollExample extends React.Component< + $FlowFixMeProps, + $FlowFixMeState, +> { state = { groupTypes: 'SavedPhotos', sliderValue: 1,