Answer the question
In order to leave comments, you need to log in
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
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.
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 questionAsk a Question
731 491 924 answers to any question