I have Interfaces like this:
interface INewsProps {
newsType: string;
data: INewsContentProps[];
}
interface INewsContentProps {
title: string;
newsContent: string;
}
My array is this:
export const newsList: INewsContentProps[] = [
{
title: 'Lorem ipsum',
newsContent: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis hendrerit dui ac accumsan consequat.'
},
{
title: 'Lorem ipsum2',
newsContent: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis hendrerit dui ac accumsan consequat.'
}
];
I need to get properties from the array to show here:
export const NewsCard = () => {
return (
<div>
<Card>
<CardActionArea>
<CardContent>
<Typography>
{props.title}
</Typography>
<Typography>
{props.newsContent}
</Typography>
<ContextMenu />
</CardContent>
</CardActionArea>
</Card>
</div>
);
};
I am new in React and also in TypeScript so I will be very grateful if someone can help me with this.