diff --git a/libs/horizon/src/renderer/vnode/VNodeCreator.ts b/libs/horizon/src/renderer/vnode/VNodeCreator.ts index 79496323..6416a7b7 100644 --- a/libs/horizon/src/renderer/vnode/VNodeCreator.ts +++ b/libs/horizon/src/renderer/vnode/VNodeCreator.ts @@ -230,7 +230,7 @@ export function onlyUpdateChildVNodes(processing: VNode): VNode | null { } }; - putChildrenIntoQueue(processing.child); + putChildrenIntoQueue(processing); while (queue.length) { const vNode = queue.shift()!; diff --git a/scripts/__tests__/ComponentTest/Memo.test.js b/scripts/__tests__/ComponentTest/Memo.test.js new file mode 100644 index 00000000..b1a6fa9f --- /dev/null +++ b/scripts/__tests__/ComponentTest/Memo.test.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved. + */ + +import * as Horizon from '@cloudsop/horizon/index.ts'; + +describe('Memo Test', () => { + it('Memo should not make the path wrong', function () { + let updateApp; + + function Child() { + const [_, update] = Horizon.useState({}); + updateApp = () => update({}); + return
; + } + const MemoChild = Horizon.memo(Child); + + function App() { + return ( +