Internal error: Error: Objects are not valid as a React child (found: object with keys {...}). If you meant to render a collection of children, use an array instead.
object타입을 지켜주면 해결된다.
// getData =
[
{
id: 'person',
username: 'pp',
password: 'personal',
email: 'dd',
address: 'dd',
age: 20
}
]
[
{
id: 'person',
username: 'pp',
password: 'personal',
email: 'dd',
address: 'dd',
age: 20
}
]
return <> {getdata} <> // 이러면 에러 발생!
return ( // 이렇게 써보자
<div>
{getdata.map((data, i) => {
return (
<>
<p>
{data.id} {data.username}
</p>
</>
)
})}
</div>
)