I have a map function inside a map function in react for this object
let timelineElements=[{
id: 2,
title: "Backend Developer",
location: "Skystead, Craonia",
description: [
"Recommend changes for reporting to enhance the overall monitoring of system, vulnerabilities and practices",
"Built data pipeline that allowed automated and efficient way of reporting using Powershell scripting, Excel , SQL and Power BI that",
],
buttonText: "View Backend Projects",
date: "June 2013 - August 2016",
icon: "work",
},
{
id: 3,
title: "Quality Assurance Engineer",
location: "South Warren, Geshington",
description: [
"Recommend changes for reporting to enhance the overall monitoring of system, vulnerabilities and practices",
"Built data pipeline that allowed automated and efficient way of reporting using Powershell scripting, Excel , SQL and Power BI that",
],
date: "September 2011 - June 2013",
icon: "work",
}]
and I already have this set up
{timelineElements.map((element) => {
return (
<p key={element.key}>
{element.title}
</p>
{element.description && element.description.map((desc) => {return (<p key={desc}>{desc}</p>);
})}
)}
I added the ** ** in the description item so that you could see where I am trying to access the data. but in the application there is no ** ** in the description.
I think that the logic holds and that it should work but when I run this
I get this error

Any help would be much appreciated!!
element.descriptionthat isn't an array or isn't an object with amapfunction property to invoke. You're mapping also doesn't appear to be valid JSX, is this a complete example? There seems to be something missing? Is anything updating thetimelineElementsvalue?timelineElementsis declared, all logic that updates it (for any reason), all the way to where you are trying to render it. Somewhere along the line it appearsdescriptionbecomes not an array or mappable object.