use key instead of ref for unique key for components in loop

This commit is contained in:
Sanjay Bhangar 2018-12-02 16:07:00 +02:00
parent e7c1caf65e
commit bee3055307

View File

@ -23,7 +23,7 @@ class Home extends React.Component {
<div> <div>
{ this.props.loading && 'Loading...'} { this.props.loading && 'Loading...'}
{ this.props.videos.map(video => { { this.props.videos.map(video => {
return (<div ref={ video.id }>{ video.title }</div>); return (<div key={ video.id }>{ video.title }</div>);
})} })}
</div> </div>
</div> </div>