If I have a static array of 4 objects and I would like to pass several data items from specifically from the third object in this array, how can this be done?
Here is an example:
const ENTRIES = [
{
name: "John"
color: "#fffff"
food: "Pasta"
},
{
name: "Ann"
color: "#f3f3f3"
food: "Salad"
},
{
name: "Mark"
color: "#000000"
food: "Sushi"
},
{
name: "Alice"
color: "#0f3cfs"
food: "Burger"
},
]
export default class SpecificItem extends Component {
render() {
return (
<SafeAreaView>
<View>
<Card
name={ENTRIES.name}
color={ENTRIES.color}
food={ENTRIES.food}
/>
</View>
</SafeAreaView>
);
}
}
If we take the following example, how would I specifically pass props for the 3rd object item with the details name: "Mark", color: "#000000", and food: "Sushi" into the component?