I
I
Ivan2020-07-01 11:17:53
React
Ivan, 2020-07-01 11:17:53

How to show Preloader in React until app is FULLY loaded?

Used React Suspense to show the preloader, but it only shows it at the initial stage of app loading. That is, the preloader disappears, and the application is not fully loaded, fonts begin to load, pictures, and so on. How to make the Preloader show up until the fonts, pictures, etc. are fully loaded. Maybe there is some library or method, please tell me.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nazariy Lazarchuk, 2020-07-04
@LazarchukNazar

Your problem is that React scripts generate new HTML when they visit the site, which in turn contains images and styles.
In this case, the preloader needs to be removed with a timer after componentDidMount/useEffect, after the rendering stage.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question