Skip to content

Commit 6734ff2

Browse files
authored
Merge pull request #4855 from preactjs/gold-suspense
Golf down suspense
2 parents 13a5ce7 + 4632097 commit 6734ff2

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

compat/src/suspense.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,6 @@ options.unmount = function (vnode) {
3131
component._onResolve();
3232
}
3333

34-
// if the component is still hydrating
35-
// most likely it is because the component is suspended
36-
// we set the vnode.type as `null` so that it is not a typeof function
37-
// so the unmount will remove the vnode._dom
38-
if (component && vnode._flags & MODE_HYDRATE) {
39-
vnode.type = null;
40-
}
41-
4234
if (oldUnmount) oldUnmount(vnode);
4335
};
4436

@@ -200,15 +192,9 @@ Suspense.prototype.render = function (props, state) {
200192
this._detachOnNextRender = null;
201193
}
202194

203-
// Wrap fallback tree in a VNode that prevents itself from being marked as aborting mid-hydration:
204-
/** @type {import('./internal').VNode} */
205-
const fallback =
206-
state._suspended && createElement(Fragment, null, props.fallback);
207-
if (fallback) fallback._flags &= ~MODE_HYDRATE;
208-
209195
return [
210196
createElement(Fragment, null, state._suspended ? null : props.children),
211-
fallback
197+
state._suspended && createElement(Fragment, null, props.fallback)
212198
];
213199
};
214200

0 commit comments

Comments
 (0)