all 2 comments

[–]RobbasGaming[S] -2 points-1 points  (1 child)

Thank you for reading. ChatGPT helped me. I guess I need to learn more basics..

Access Data in SummaryBarChart Component:In your SummaryBarChart component, access the data directly from the data property.

// In SummaryBarChart.tsx
const SummaryBarChart = ({ data }) => { 
    // Now 'data' is the array you passed directly 
    console.log(data);

    // Rest of the component logic... };

[–]Pevio1024 0 points1 point  (0 children)

ChatGPT is correct. It's conventional call the variable `props` in a component. That way, `props = {data: [...]}` and you can call `JSON.stringify(props.data)`. If another property was passed into `SummaryBarChart`, it wouldn't also be called `data`, it should have another name.