0fa95da53f
* Encapsulate initial rendering * Run dev code before rendering * Fix call * Try reverting last change, fixing call
18 lines
581 B
TypeScript
18 lines
581 B
TypeScript
// This function is used to remove Next.js' no-FOUC styles workaround for using
|
|
// `style-loader` in development. It must be called before hydration, or else
|
|
// rendering won't have the correct computed values in effects.
|
|
export function displayContent(): Promise<void> {
|
|
return new Promise((resolve) => {
|
|
;(window.requestAnimationFrame || setTimeout)(function () {
|
|
for (
|
|
var x = document.querySelectorAll('[data-next-hide-fouc]'),
|
|
i = x.length;
|
|
i--;
|
|
|
|
) {
|
|
x[i].parentNode!.removeChild(x[i])
|
|
}
|
|
resolve()
|
|
})
|
|
})
|
|
}
|