I am new to React. I have a component that is meant to display a profile's data.
I am unsure as to how to pass that to the component. It seems to me the best way is to send it as an array. Eg:
const person = {
name: 'Bill',
age: 42,
sex: 'male',
occupation: 'driver',
};
And to output it somewhat like:
return (
<Typography variant="h6">{person.name}</Typography>
<Typography variant="body1">{person.age}</Typography>
<Typography variant="body1">{person.sex}</Typography>
<Typography variant="body1">{person.occupation}</Typography>
)
I'm just not sure how to do this and cannot find anything on Google or SO.
Would anyone be able point me in the right direction?