M
M
Maxim Semiletkin2020-10-29 13:24:15
css
Maxim Semiletkin, 2020-10-29 13:24:15

How to make a stub until the data has arrived?

Good afternoon, ladies and gentlemen. Tell me the best way to create a block stub like on Avito for iPhones. I want to come up with something, but it's pretty hard. Maybe there is a library. I'm writing in react, I'll be glad to hear your answers. Good time of day)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex, 2020-10-29
@Kozack

So what's the problem? By default, you display anything, even a gray rectangle, even a beautiful animation. How the data came in: replace the stub with the content.

K
Kirill Makarov, 2020-11-02
@kirbi1996

You create state isLoading
When loading data, change it from true to false
Then, if loading is in progress, return your spinner component or just whatever you like
How everything loaded its content

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question