V
V
Vadim Stepanenko2021-06-07 18:23:29
React
Vadim Stepanenko, 2021-06-07 18:23:29

Big tree house, how can you optimize?

Hey!
I make a feed by analogy with tiktok - only 1 slide is visible on the screen, when you swipe up from the bottom, the current slide goes up, and a new one appears from the bottom. New slides are loaded if there are 5 slides left before the last slide.
Each slide contains pictures, text, and so on.

If the user scrolls through the feed for 5 minutes, then the house will become huge, friezes will begin. Can you tell me how to optimize the feed? Application on react, self-written scroll module (slides are just height: 100vh and scroll to the next screen on css)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Shvedov, 2021-06-07
@mmmaaak

If they scroll one by one, why can't you only render the current one, well, let's have two neighboring ones, so that there is something to scroll forward / backward on? why render finally everything that was loaded?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question