use key instead of ref for unique key for components in loop
This commit is contained in:
parent
e7c1caf65e
commit
bee3055307
|
@ -23,7 +23,7 @@ class Home extends React.Component {
|
|||
<div>
|
||||
{ this.props.loading && 'Loading...'}
|
||||
{ this.props.videos.map(video => {
|
||||
return (<div ref={ video.id }>{ video.title }</div>);
|
||||
return (<div key={ video.id }>{ video.title }</div>);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user