I have the below prop being passed in my component, which should then display it.
const userData = {'name':'Tom','hobbies':['Basketball','Judo']}
const userDataDisplay = props => {
return (
<>
<h2>{props.name}</h2>
<p>{props.hobbies.map(hobby=><li>{hobby}</li>)}</p>
</>
)
}
But When I add another user, both the usernames come first and then the hobbies, when what I need is the hobbies for each user to come after the name.
Tom
Sam
Basketball
Judo
Carrom
appears instead of
Tom
Basketball
Judo
Sam
Carrom
What obvious thing am I missing?