Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export { signal, computed, batch, effect, Signal, type ReadonlySignal };
const Empty = [] as const;
const ReactElemType = Symbol.for("react.element"); // https://github.com/facebook/react/blob/346c7d4c43a0717302d446da9e7423a8e28d8996/packages/shared/ReactSymbols.js#L15
const ReactMemoType = Symbol.for("react.memo"); // https://github.com/facebook/react/blob/346c7d4c43a0717302d446da9e7423a8e28d8996/packages/shared/ReactSymbols.js#L30
const ReactLazyType = Symbol.for("react.lazy"); // https://github.com/facebook/react/blob/346c7d4c43a0717302d446da9e7423a8e28d8996/packages/shared/ReactSymbols.js#L31
const ProxyInstance = new WeakMap<
FunctionComponent<any>,
FunctionComponent<any>
Expand Down Expand Up @@ -166,6 +167,10 @@ function WrapJsx<T>(jsx: T): T {
return jsx.call(jsx, type, props, ...rest);
}

if (type && typeof type === "object" && type.$$typeof === ReactLazyType) {
return jsx.call(jsx, ProxyFunctionalComponent(type._init(type._payload)), props, ...rest);
}

if (typeof type === "string" && props) {
for (let i in props) {
let v = props[i];
Expand Down