Skip to content

Commit b1bc047

Browse files
committed
Better handle solid.lazy
Requires solidjs/solid#2389
1 parent ac36b2a commit b1bc047

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

packages/debugger/src/structure/walker.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,24 @@ function mapOwner(
162162

163163
let first_owned: Solid.Owner | undefined
164164

165+
/*
166+
solid.lazy(MyComponent) hoc
167+
↳ wrap (callback returned from lazy, called as a component)
168+
↳ memo
169+
↳ MyComponent
170+
*/
171+
if (name === 'wrap' &&
172+
typeof ((owner as Solid.Component).component as any)?.preload === 'function' &&
173+
owner.owned &&
174+
owner.owned.length === 1 &&
175+
markOwnerType((first_owned = owner.owned[0]!)) === NodeType.Memo &&
176+
first_owned.owned &&
177+
first_owned.owned.length === 1 &&
178+
markOwnerType((first_owned = first_owned.owned[0]!)) === NodeType.Component
179+
) {
180+
return mapOwner(first_owned, parent)
181+
}
182+
165183
/*
166184
Context
167185

0 commit comments

Comments
 (0)