Skip to content

Commit 746132b

Browse files
grabbouzebulgar
authored andcommitted
Document ListView.DataSource facebook#410
Summary:Fixes facebook#410 Closes facebook#7193 Differential Revision: D3217718 fb-gh-sync-id: c05c9e3d67863c064f8e1102090614c6ba7e3127 fbshipit-source-id: c05c9e3d67863c064f8e1102090614c6ba7e3127
1 parent e1cec4b commit 746132b

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

Libraries/CustomComponents/ListView/ListView.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ var DEFAULT_SCROLL_CALLBACK_THROTTLE = 50;
5656
/**
5757
* ListView - A core component designed for efficient display of vertically
5858
* scrolling lists of changing data. The minimal API is to create a
59-
* `ListView.DataSource`, populate it with a simple array of data blobs, and
60-
* instantiate a `ListView` component with that data source and a `renderRow`
61-
* callback which takes a blob from the data array and returns a renderable
62-
* component.
59+
* [`ListView.DataSource`](docs/listviewdatasource.html), populate it with a simple
60+
* array of data blobs, and instantiate a `ListView` component with that data
61+
* source and a `renderRow` callback which takes a blob from the data array and
62+
* returns a renderable component.
6363
*
6464
* Minimal example:
6565
*
@@ -117,7 +117,9 @@ var ListView = React.createClass({
117117
*/
118118
propTypes: {
119119
...ScrollView.propTypes,
120-
120+
/**
121+
* An instance of [ListView.DataSource](docs/listviewdatasource.html) to use
122+
*/
121123
dataSource: PropTypes.instanceOf(ListViewDataSource).isRequired,
122124
/**
123125
* (sectionID, rowID, adjacentRowHighlighted) => renderable

website/server/extractDocs.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,13 @@ function isRunnable(componentName, componentPlatform) {
107107

108108
// Hide a component from the sidebar by making it return false from
109109
// this function
110-
function shouldDisplayInSidebar(componentName) {
111-
if (componentName === 'Transforms') {
112-
return false;
113-
}
110+
var HIDDEN_COMPONENTS = [
111+
'Transforms',
112+
'ListViewDataSource',
113+
];
114114

115-
return true;
115+
function shouldDisplayInSidebar(componentName) {
116+
return HIDDEN_COMPONENTS.indexOf(componentName) === -1;
116117
}
117118

118119
function getNextComponent(i) {
@@ -271,6 +272,7 @@ var apis = [
271272
'../Libraries/LayoutAnimation/LayoutAnimation.js',
272273
'../Libraries/Linking/Linking.js',
273274
'../Libraries/LinkingIOS/LinkingIOS.js',
275+
'../Libraries/CustomComponents/ListView/ListViewDataSource.js',
274276
'../node_modules/react/lib/NativeMethodsMixin.js',
275277
'../Libraries/Network/NetInfo.js',
276278
'../node_modules/react/lib/PanResponder.js',

0 commit comments

Comments
 (0)