M
M
MrZillaGold2020-02-23 12:42:48
JavaScript
MrZillaGold, 2020-02-23 12:42:48

How can element rendering be optimized?

I iterate over 500 array elements and create a span for each element.
There is a big freeze happening on mobile devices.
How can you optimize the loading of elements in this case?

[...Array(542)].map((value, index) => 
                                <span 
                                       key={icon}
                                       className={`item-icon item-icon-${icon}`}
                                    />
                            }
                        )

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-02-23
@MrZillaGold

There is not enough information, of course... But, it seems to me, it is better to perform such an operation on the back, and give the finished page to the front.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question