I'm passing an array (data) to the Segment component via a prop. But then I can't map over data. I'm sure it's a really obvious mistake but I just don't see it :(
import React from 'react';
import SegmentLine from './SegmentLine';
const Segment = ({ data }) => {
console.log(data);
return data && data.map((line, i) => <SegmentLine key={i} data={line} />);
};
export default Segment;
The console.log is this:
Any help is greatly appreciated! Thanks in advance :)

{}around map, also it seems like your data from some api calls, so you need to make your code to wait till the data arrives then only you can perform mapdata &&I think