Skip to content

Commit

Permalink
revert: revert suspence event
Browse files Browse the repository at this point in the history
  • Loading branch information
answershuto committed Sep 13, 2024
1 parent a4755e4 commit 8c432a4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/runtime/src/Suspense.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ export function withSuspense(Component) {
<SuspenseContext.Provider value={suspenseState}>
<Component {...componentProps} />
<Data id={id} />
<script dangerouslySetInnerHTML={{ __html: `window.dispatchEvent(new CustomEvent('suspense', { detail: { id: '${id}' } }));` }} />
</SuspenseContext.Provider>
</React.Suspense>
);
Expand All @@ -167,6 +166,6 @@ function Data(props) {
const data = useSuspenseData();

return (
<script id={props.id ? `suspenseScript:${props.id}` : ''} dangerouslySetInnerHTML={{ __html: `!function(){window['${LOADER}'] = window['${LOADER}'] || {};window['${LOADER}']['${props.id}'] = ${JSON.stringify(data)}}();` }} />
<script dangerouslySetInnerHTML={{ __html: `!function(){window['${LOADER}'] = window['${LOADER}'] || {};window['${LOADER}']['${props.id}'] = ${JSON.stringify(data)}}();` }} />
);
}

0 comments on commit 8c432a4

Please sign in to comment.