Match-id-a259fe636f4eae5da9d6448d48172e8ce9dcfcee

This commit is contained in:
* 2022-09-14 14:51:37 +08:00 committed by *
parent 76e84e5022
commit 0b11905b35
2 changed files with 42 additions and 1 deletions

View File

@ -230,7 +230,7 @@ export function onlyUpdateChildVNodes(processing: VNode): VNode | null {
}
};
putChildrenIntoQueue(processing.child);
putChildrenIntoQueue(processing);
while (queue.length) {
const vNode = queue.shift()!;

View File

@ -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 <div></div>;
}
const MemoChild = Horizon.memo(Child);
function App() {
return (
<div>
<MemoChild />
</div>
);
}
const MemoApp = Horizon.memo(App);
Horizon.render(
<div>
<MemoApp key="1" />
</div>,
container
);
Horizon.render(
<div>
<span></span>
<MemoApp key="1" />
</div>,
container
);
expect(() => updateApp()).not.toThrow();
});
});