I have an app written in reactjs, it's pretty fast when the components are rendered, but it's too slow for it to be rendered. On computer, it takes about 2 seconds, but on mobile, it takes around 8 seconds for the page to be rendered, it's really too slow.
Is there any generic methods to improve loading time for the website?
I also saw there is a long pause before the doms are shown, I am not sure what the browser does during this time and how to solve this.
You should definitely pre-compile your React code for production. Also it is very important to set your
production. This will speed up general and initial rendering by a lot (even more so for server-side rendering).
You could use the browserify plugin
envify for this, or the corresponding webpack plugin (depending on your stack).
Also I recommend this conference talk, which includes lots of other minor/major rendering speed-ups: https://www.youtube.com/watch?v=PnpfGy7q96U