Skip to content

Commit

Permalink
Improve first render of the app
Browse files Browse the repository at this point in the history
  • Loading branch information
mthh committed Jul 5, 2024
1 parent 63a3e73 commit c9fc307
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ if (s instanceof HTMLLinkElement) {
// (to avoid the flash of unstyled content)
if (s.sheet) firstRender();
else {
s.addEventListener('load', () => {
const onload = () => {
firstRender();
});
s.removeEventListener('load', onload);
};
s.addEventListener('load', onload);
}
} else {
// In dev we can just render the app right away
Expand Down

0 comments on commit c9fc307

Please sign in to comment.