Answer the question
In order to leave comments, you need to log in
What is the correct way to add n number of arrays in 1 iteration and div wrapper every 5 iterations?
There is an array, a larger number comes, let's say 100 pieces.
I need to cram the number of these arrays into one slider by n, for example 5 pieces. and wrap it in a div. In general, what would be 1 slide. I use the react-slick library
<Slider {...settingsSlider}>
{data.map((elem, i)=> (
<div className="slider_coin">
<div className="slider_coin_icon">
<img src={elem.icon} alt="" />
</div>
<div className="slider_coin_info">
<h4>{elem.name}</h4>
<p>{elem.price_usdt} $ {elem.percent_change > 0 ?
<span className='distributionSchedule_green'>
+{elem.percent_change?.toFixed(1)}%
</span>
:
<span className='distributionSchedule_red'>
{elem.percent_change?.toFixed(1)}%
</span>
}</p>
</div>
</div>
))
}
</Slider>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question