Skip to content

Commit

Permalink
Update sectionList keyExtractor docs
Browse files Browse the repository at this point in the history
Summary:
Added language to explain that you still need to add keys for each section even if you use a keyExtractor method.

No code changed; just clarified documentation.
Closes #15007

Differential Revision: D5425897

Pulled By: hramos

fbshipit-source-id: db44064a28a673feeda5a6765ea45217d3ae51e2
  • Loading branch information
fourestfire authored and facebook-github-bot committed Jul 14, 2017
1 parent ccb4e67 commit cb9b266
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Libraries/Lists/SectionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ type OptionalProps<SectionT: SectionBase<any>> = {
/**
* Used to extract a unique key for a given item at the specified index. Key is used for caching
* and as the react key to track item re-ordering. The default extractor checks item.key, then
* falls back to using the index, like react does.
* falls back to using the index, like react does. Note that this sets keys for each item, but
* each overall section still needs its own key.
*/
keyExtractor: (item: Item, index: number) => string,
/**
Expand Down

0 comments on commit cb9b266

Please sign in to comment.