The array
const props: NavButtonProps[] = [
{
text: "Home",
url: "teste"
},
{
text: "Services",
url: "teste"
},
{
text: "projects",
url: "teste"
}
]
where the method map is used
const NavButtonWrapper = (buttons: NavButtonProps[]): ReactElement => {
return (
<div className="flex space-x-16">
{ buttons.map((button) => { return (<NavButton {...button}/>)})}
</div>
)
}
I’ve already seen some cases where it works, but i don’t know why in my code it returns buttons.map is not a function
New contributor
João Lucas Rodrigues da Silva is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.