File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
packages/react/runtime/src Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1616
1717import { render } from 'preact' ;
1818import type { Attributes , ContainerNode , VNode } from 'preact' ;
19- import { cloneElement } from 'preact/compat' ;
19+ import { cloneElement , unmountComponentAtNode } from 'preact/compat' ;
2020import { jsx as createVNode } from 'preact/jsx-runtime' ;
2121
2222import type { Worklet , WorkletRefImpl } from '@lynx-js/react/worklet-runtime/bindings' ;
@@ -737,6 +737,9 @@ function renderMTC(snapshotInstance: SnapshotInstance, props: MTCProps) {
737737 if ( vnode . __e ) {
738738 snapshotInstance . insertBefore ( vnode . __e as SnapshotInstance ) ;
739739 ( vnode . __e as SnapshotInstance ) . __onDestroy = ( ) => {
740+ wrapper . insertBefore ( vnode . __e as SnapshotInstance ) ;
741+ unmountComponentAtNode ( wrapper as unknown as ContainerNode ) ;
742+ // TODO: destroy wrapper
740743 mtcComponentVNodes . delete ( instanceId ) ;
741744 } ;
742745 }
You can’t perform that action at this time.
0 commit comments