Skip to content

Commit

Permalink
emmm
Browse files Browse the repository at this point in the history
  • Loading branch information
yisar committed May 29, 2023
1 parent fc96ae0 commit 186a630
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/reconcile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const updateHook = <P = Attributes>(fiber: IFiber): any => {
resetCursor()
currentFiber = fiber
let children = (fiber.type as FC<P>)(fiber.props)
diffKids(fiber, simpleVnode(children))
reconcileChidren(fiber, simpleVnode(children))
}

const updateHost = (fiber: IFiber): void => {
Expand All @@ -115,7 +115,7 @@ const updateHost = (fiber: IFiber): void => {
if (fiber.type === 'svg') fiber.lane |= TAG.SVG
fiber.node = createElement(fiber) as HTMLElementEx
}
diffKids(fiber, fiber.props.children)
reconcileChidren(fiber, fiber.props.children)
}

const simpleVnode = (type: any) =>
Expand All @@ -127,13 +127,12 @@ const getParentNode = (fiber: IFiber): HTMLElement | undefined => {
}
}

const diffKids = (fiber: any, children: FreNode): void => {
const reconcileChidren = (fiber: any, children: FreNode): void => {
let aCh = fiber.kids || [],
bCh = (fiber.kids = arrayfy(children) as any)
const actions = diff(aCh, bCh)

for (let i = 0, prev = null, len = bCh.length; i < len; i++) {

const child = bCh[i]
child.action = actions[i]
if (fiber.lane & TAG.SVG) {
Expand Down

0 comments on commit 186a630

Please sign in to comment.