Update sectionList keyExtractor docs
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 https://github.com/facebook/react-native/pull/15007 Differential Revision: D5425897 Pulled By: hramos fbshipit-source-id: db44064a28a673feeda5a6765ea45217d3ae51e2
This commit is contained in:
parent
ccb4e67756
commit
cb9b266b8e
|
@ -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
|
* 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
|
* 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,
|
keyExtractor: (item: Item, index: number) => string,
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue