Skip to content

Commit

Permalink
revert: revert suspence event (#6994)
Browse files Browse the repository at this point in the history
* revert: revert suspence event

* revert: add changelog
  • Loading branch information
answershuto authored Sep 24, 2024
1 parent a4755e4 commit f50fe55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/curvy-jars-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ice/runtime': patch
---

revert: revert suspence event
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 f50fe55

Please sign in to comment.