Skip to content
Advertisement

Map dictionary keys to rows and display its values

I have a list of dictionaries set as props in my React component, like so:

JavaScript

The dicts:

JavaScript

And I need to display their NAMES in the rows, each row based on a respective fruit color:

JavaScript

export default Basket;


How can I map fruit object values from this list os dicts and display fruit names assigning each name to its respective row color?

Advertisement

Answer

Working sandbox

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement