diff --git a/Examples/UIExplorer/js/FlatListExample.js b/Examples/UIExplorer/js/FlatListExample.js
index 2dac3dd1449..83e754a5633 100644
--- a/Examples/UIExplorer/js/FlatListExample.js
+++ b/Examples/UIExplorer/js/FlatListExample.js
@@ -127,7 +127,7 @@ class FlatListExample extends React.PureComponent {
}
ListFooterComponent={FooterComponent}
data={filteredData}
debug={this.state.debug}
diff --git a/Libraries/Lists/FlatList.js b/Libraries/Lists/FlatList.js
index d5d785e141c..17ccf2ce845 100644
--- a/Libraries/Lists/FlatList.js
+++ b/Libraries/Lists/FlatList.js
@@ -49,13 +49,15 @@ type OptionalProps = {
*/
ItemSeparatorComponent?: ?ReactClass,
/**
- * Rendered at the bottom of all the items.
+ * Rendered at the bottom of all the items. Can be a React Component Class, a render function, or
+ * a rendered element.
*/
- ListFooterComponent?: ?ReactClass,
+ ListFooterComponent?: ?(ReactClass | React.Element),
/**
- * Rendered at the top of all the items.
+ * Rendered at the top of all the items. Can be a React Component Class, a render function, or
+ * a rendered element.
*/
- ListHeaderComponent?: ?ReactClass,
+ ListHeaderComponent?: ?(ReactClass | React.Element),
/**
* Optional custom style for multi-item rows generated when numColumns > 1.
*/
diff --git a/Libraries/Lists/SectionList.js b/Libraries/Lists/SectionList.js
index d4f9934f942..8b7409d9b1d 100644
--- a/Libraries/Lists/SectionList.js
+++ b/Libraries/Lists/SectionList.js
@@ -51,11 +51,11 @@ type OptionalProps> = {
/**
* Rendered at the very beginning of the list.
*/
- ListHeaderComponent?: ?ReactClass,
+ ListHeaderComponent?: ?(ReactClass | React.Element),
/**
* Rendered at the very end of the list.
*/
- ListFooterComponent?: ?ReactClass,
+ ListFooterComponent?: ?(ReactClass | React.Element),
/**
* Rendered in between each section.
*/
diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js
index 93205d22033..5b85a54ac3d 100644
--- a/Libraries/Lists/VirtualizedList.js
+++ b/Libraries/Lists/VirtualizedList.js
@@ -377,9 +377,12 @@ class VirtualizedList extends React.PureComponent {
const stickyIndicesFromProps = new Set(this.props.stickyHeaderIndices);
const stickyHeaderIndices = [];
if (ListHeaderComponent) {
+ const element = React.isValidElement(ListHeaderComponent)
+ ? ListHeaderComponent
+ : ;
cells.push(
-
+ {element}
);
}
@@ -450,9 +453,12 @@ class VirtualizedList extends React.PureComponent {
}
}
if (ListFooterComponent) {
+ const element = React.isValidElement(ListFooterComponent)
+ ? ListFooterComponent
+ : ;
cells.push(
-
+ {element}
);
}
diff --git a/Libraries/Lists/VirtualizedSectionList.js b/Libraries/Lists/VirtualizedSectionList.js
index d35eb2bcdc1..d6de9f38d2c 100644
--- a/Libraries/Lists/VirtualizedSectionList.js
+++ b/Libraries/Lists/VirtualizedSectionList.js
@@ -48,11 +48,11 @@ type OptionalProps = {
/**
* Rendered after the last item in the last section.
*/
- ListFooterComponent?: ?ReactClass<*>,
+ ListFooterComponent?: ?(ReactClass<*> | React.Element<*>),
/**
* Rendered at the very beginning of the list.
*/
- ListHeaderComponent?: ?ReactClass<*>,
+ ListHeaderComponent?: ?(ReactClass<*> | React.Element<*>),
/**
* Default renderer for every item in every section.
*/