From 387751fff480d29baa27e440610420473ab926d7 Mon Sep 17 00:00:00 2001 From: Rob Misiorowski Date: Sat, 23 May 2020 10:57:34 -0600 Subject: [PATCH] ability to derive Item key from item data --- src/Item.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Item.js b/src/Item.js index fa99552c..f3b6e71b 100644 --- a/src/Item.js +++ b/src/Item.js @@ -78,6 +78,10 @@ export default class Item extends Component { restProps.onClick = this.onClick; } + if (typeof item.key === 'string') { + restProps.key = item.key; + } + return (
  • {renderItem(item, { isHighlighted, ...renderItemData })}