I am currently working on a Next.js static site. The JavaScript loads quickly, but there seems to be a delay in applying the styled-components CSS as seen in the screenshot. The CSS only kicks in after the page has fully loaded.
Does anyone have any suggestions on how I can make sure that the styled-components CSS is applied without any lag?
https://i.sstatic.net/o7lZq.gif
UPDATE: I just realized that this is a static application---meaning that nextjs will pre-render the page output first, before loading the JavaScript. This implies that standard techniques for waiting for JS to load should work. However, since the static HTML is automatically generated by nextjs, I need to find a way to do this through nextjs itself.