Skip to content

Commit 9af40f9

Browse files
committed
partial fix
1 parent bfa808f commit 9af40f9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ function _renderToString(
245245
);
246246

247247
if (afterDiff) afterDiff(vnode);
248-
vnode[PARENT] = undefined;
248+
// when we are dealing with suspense we can't do this...
249+
// vnode[PARENT] = undefined;
249250

250251
if (options.unmount) options.unmount(vnode);
251252

@@ -394,7 +395,7 @@ function _renderToString(
394395
}
395396

396397
if (afterDiff) afterDiff(vnode);
397-
vnode[PARENT] = undefined;
398+
//vnode[PARENT] = undefined;
398399
if (ummountHook) ummountHook(vnode);
399400

400401
// Emit self-closing tag for empty void elements:

src/lib/chunked.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export async function renderToChunks(vnode, { context, onWrite, abortSignal }) {
3939
function handleError(error, vnode, renderChild) {
4040
if (!error || !error.then) return;
4141

42+
console.log('--- IN HANDLER ---');
4243
// walk up to the Suspense boundary
4344
while ((vnode = vnode[PARENT])) {
4445
let component = vnode[COMPONENT];
@@ -50,6 +51,7 @@ function handleError(error, vnode, renderChild) {
5051
if (!vnode) return;
5152

5253
let root = vnode;
54+
// TODO: we can't unset parent because of this traversal to Suspense
5355
while (root !== null && !root.mask && root[PARENT] !== null) {
5456
root = root[PARENT];
5557
}
@@ -68,6 +70,7 @@ function handleError(error, vnode, renderChild) {
6870

6971
const promise = error.then(
7072
() => {
73+
console.log('resolved');
7174
if (abortSignal && abortSignal.aborted) return;
7275
this.onWrite(createSubtree(id, renderChild(vnode.props.children)));
7376
},

0 commit comments

Comments
 (0)