0

I have this state which is store in a single object, the subject are the keys.

enter image description here


My code, I need to pass the corresponding array to Timeline component,(Timeline component will handle the mapping of array that will be pass) any idea?

   Object.keys(newTimelineData).map(title => (
      <Timeline
        chartId={title}
        timelineData={title.array} // array should be here
        {...timelineChartProps}
      />
    )
Craicerjack
  • 5,890
  • 2
  • 30
  • 38
Drew Cordano
  • 634
  • 5
  • 14

1 Answers1

0

try this

 Object.keys(newTimelineData).map(title => (
      <Timeline
        chartId={title}
        timelineData={state[title]} // array should be here
        {...timelineChartProps}
      />
    )