The first screen of react project flashes after build.

after the react project build, the dom is loaded first when the first screen is accessed, but the style is not loaded, and the style comes out after a while, resulting in a feeling of flickering on the page. It is intended to add a loading only when the first screen is accessed, and the dom node of this loading will never appear after the first screen is rendered.

Jun.03,2022

just write that part of the loading style in index.html .

  

react-loadable is a solution, which can also be implemented by yourself. Learn about the dynamic loading of import ()

Menu