Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 9e5a0be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion webpack_in/entry.jsx
Expand Up @@ -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>
Expand Down

0 comments on commit 9e5a0be

Please sign in to comment.