Skip to content
Permalink
Browse files

Modified <ListWidget> rendering logic to use item ID rather than arra…

…y index as the React key for the items listing, as an item's array index can change, while the ID will remain constant throughout its lifetime.
  • Loading branch information
maratbn committed Aug 5, 2018
1 parent c8a1e79 commit 9e5a0be8e285e4925b5b86043a8bdde53d9f9bee
Showing with 1 addition and 1 deletion.
  1. +1 −1 webpack_in/entry.jsx
@@ -109,7 +109,7 @@ class ListWidget extends React.Component {
<div style={ objStyleCommon }>
<div style={ objStyleContent }>
<ul style={{ display: 'inline-block', textAlign: 'left' }}>
{ this.state.items.map((objItem, index) => (<li key={ index }>
{ this.state.items.map((objItem, index) => (<li key={ objItem.id }>
{ objItem.caption }
</li>)) }
</ul>

0 comments on commit 9e5a0be

Please sign in to comment.
You can’t perform that action at this time.