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
  • 6,203
  • 2
  • 31
  • 39
Drew Cordano
  • 962
  • 9
  • 16

1 Answers1

0

try this

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