P
P
picka2021-08-27 11:37:17
React
picka, 2021-08-27 11:37:17

How to render an array of articles into different components?

I have two components - 'CardBig' and 'CardSmall', also have an array of articles that I would like to display through these components.

If there is one component, then I would do this:

{props.articles.map((article) => (
    <CardNewsSmall media={article.media} category={article.category.name} title={article.title} date={article.date} />
 ))}

But I want 'CardBig' to be first, then 4 'CardSmall', and then again. How to implement it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2021-08-27
@0xD34F

https://jsfiddle.net/wd7j5gt1/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question