Skip to content

Commit f435041

Browse files
committed
Fix redundant rendering
1 parent 0dcf7bf commit f435041

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/teact/teact.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ function createComponentInstance(Component: FC, props: Props, children: any[]):
185185
}
186186

187187
const componentInstance: ComponentInstance = {
188-
id: ++lastComponentId,
188+
id: -1,
189189
$element: undefined as unknown as VirtualElementComponent,
190190
Component,
191191
name: Component.name,
@@ -485,6 +485,7 @@ export function hasElementChanged($old: VirtualElement, $new: VirtualElement) {
485485
}
486486

487487
export function mountComponent(componentInstance: ComponentInstance) {
488+
componentInstance.id = ++lastComponentId;
488489
renderComponent(componentInstance);
489490
componentInstance.mountState = MountState.Mounted;
490491
return componentInstance.$element;

0 commit comments

Comments
 (0)