Skip to content

Commit

Permalink
feat: add first-full-screen-paint in FirstChunkCache
Browse files Browse the repository at this point in the history
  • Loading branch information
XXXMrG committed Dec 11, 2024
1 parent cd2b97e commit 81dd0b1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/runtime/src/Document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,20 @@ export const Data: DataType = (props: DataProps) => {
export type FirstChunkCacheType = () => JSX.Element;

export const FirstChunkCache: FirstChunkCacheType = () => {
return <div dangerouslySetInnerHTML={{ __html: '<!--fcc-->' }} />;
return (
<>
<script
dangerouslySetInnerHTML={{
__html: 'window.dispatchEvent(new Event("first-full-screen-paint"));',
}}
/>
<div
dangerouslySetInnerHTML={{
__html: '<!--fcc-->',
}}
/>
</>
);
};

export type MainType = (props: React.HTMLAttributes<HTMLDivElement>) => JSX.Element;
Expand Down

0 comments on commit 81dd0b1

Please sign in to comment.