2022-03-04 Learning record--React-React scaffolding implements traversal, need to add key

React scaffolding implements traversal, to addkey

insert image description here
insert image description here
Corresponding code:

{
    
    
	this.props.users.map((userObj) => {
    
    
		return (
			<div key={
    
    userObj.id} className="card">
				<a rel='noreferrer' href={
    
    userObj.html_url} target='_blank'>
					<img src={
    
    userObj.avatar_url} style={
    
    {
    
    width:'100px'}} alt="head_portrait"/>
				</a>
				<p className='card-text'>{
    
    userObj.login}</p>
			</div>
		)
	)
}

These are the study notes of the bilibili Shang Silicon Valley React learning video~

Guess you like

Origin blog.csdn.net/weixin_48850734/article/details/123287447