Permalink
Browse files

Fix SectionList examples in documentation

Summary:
Document to change http://facebook.github.io/react-native/releases/next/docs/sectionlist.html

This example is not documented incorrectly.

According to Flow-type in the [source code](https://github.com/facebook/react-native/blob/master/Libraries/Lists/SectionList.js#L25-L52) the `title` is not required and the `renderItem` method takes wrong `item.title` for rendering in example. See #15234 (comment)

![screen shot 2017-07-28 at 12 24 03 pm](https://user-images.githubusercontent.com/8013313/28702472-b72d160a-738f-11e7-96ba-dcd7e8ce4ff2.png)
Closes #15234

Differential Revision: D5518721

Pulled By: hramos

fbshipit-source-id: 4effe3778aac09a0807acc8a002e588ea2d723f9
  • Loading branch information...
timwangdev authored and facebook-github-bot committed Jul 28, 2017
1 parent bf7cf18 commit 0e93f4fa293a81a673b0e8b4aca611cd777fce82
Showing with 5 additions and 5 deletions.
  1. +5 −5 Libraries/Lists/SectionList.js
@@ -217,8 +217,8 @@ type DefaultProps = typeof defaultProps;
* Simple Examples:
*
* <SectionList
* renderItem={({item}) => <ListItem title={item.title} />}
* renderSectionHeader={({section}) => <H1 title={section.title} />}
* renderItem={({item}) => <ListItem title={item} />}
* renderSectionHeader={({section}) => <Header title={section.title} />}
* sections={[ // homogenous rendering between sections
* {data: [...], title: ...},
* {data: [...], title: ...},
@@ -228,9 +228,9 @@ type DefaultProps = typeof defaultProps;
*
* <SectionList
* sections={[ // heterogeneous rendering between sections
* {data: [...], title: ..., renderItem: ...},
* {data: [...], title: ..., renderItem: ...},
* {data: [...], title: ..., renderItem: ...},
* {data: [...], renderItem: ...},
* {data: [...], renderItem: ...},
* {data: [...], renderItem: ...},
* ]}
* />
*

0 comments on commit 0e93f4f

Please sign in to comment.