更新时间:2023-01-16 14:33:37
您没有返回 JSX
地图函数
内的内容。
You are not returning the JSX
content inside your map function
.
renderUser(user) {
return ( // Added a return statement here
<div className={ styles.card }>
<h4>{ user.name }</h4>
<p>Lego Inc</p>
<a>Email</a>
</div>
)
}
此外,您还需要使用console.log( $ {userList}
), console.log(userList)
会工作,但与问题无关。只想添加答案
Also you need to use console.log(${userList}
) is not required, console.log(userList)
will work, however that not relevant to the problem. Just wanted to add to the answer