I have my Homepage which sends a modal component a profile like this.
<ProfileOverviewModal
open={openProfile}
onClose={closeAllModals}
onCreateProfile={onCreateProfile}
profile={state.profil}
/>
In my ProfileOverviewModal.tsx I have this props
type Props = {
open: boolean
onClose: () => void
onCreateProfile: (values: ProfileModalFormValues) => void
profile: Profil[]
}
When I console.log(profile) everything seems to work. This shows up in the console:
{Firstname: 'Eddy', Lastname: 'Browkin', __typename: 'Profil'}
But I can not access profile.Firstname && profile.Lastname for example
return (<h1>{profile.Firstname}</h1>)
Why is that? Any one can point me in the right direction.
profile: Profil[]and excessing like single object?profile, e.g.return profile.map((prof) => <h1>{prof.firstName}</h1>)