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 https://github.com/facebook/react-native/pull/15234#issuecomment-318555336

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

Differential Revision: D5518721

Pulled By: hramos

fbshipit-source-id: 4effe3778aac09a0807acc8a002e588ea2d723f9
This commit is contained in:
Tim Wang 2017-07-28 12:39:29 -07:00 committed by Facebook Github Bot
parent bf7cf189b8
commit 0e93f4fa29

View File

@ -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: ...},
* ]}
* />
*