Is there a way I can destructure my data in my function arguments?
const AgendaItem = ({ item }) => {
const { venue, organiser, startTime, endTime, description } = item;
return (
<View>
<Text>Location: {venue}</Text>
<Text>Consultant: {organiser}</Text>
<Text>Time: {`${startTime} - ${endTime}`}</Text>
<Text>Description: {description || "None"}</Text>
<Text>Description: {description || "None"}</Text>
</View>
);
};
export default AgendaItem;
If I do:
const AgendaItem = ({ venue, organiser /*..etc*/ }) => {
I get undefined
when I return
them.
Any ideas?