fix: better FOUC prevention
This commit is contained in:
parent
55985e40e0
commit
6b9738cb67
|
@ -34,10 +34,7 @@ class Ssr extends Transform {
|
|||
this.push(
|
||||
string.replace(
|
||||
'<div id="root"></div>',
|
||||
`<div id="root"${
|
||||
// What FOUC? ;)
|
||||
'production' !== NODE_ENV ? ' style="display: none"' : ''
|
||||
}>${output}</div>`,
|
||||
`<div id="root">${output}</div>`,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
</head>
|
||||
<body>
|
||||
<div id="<%= htmlWebpackPlugin.options.appMountId %>"></div>
|
||||
<!-- Prevent FOUC. -->
|
||||
<script>window.document.querySelector('#root').style.display = 'none'</script>
|
||||
<script src="/flecks.config.js"></script>
|
||||
<%= htmlWebpackPlugin.tags.bodyTags %>
|
||||
</body>
|
||||
|
|
Loading…
Reference in New Issue
Block a user