@@ -26,7 +26,6 @@ import { elementPropNames, getClassName } from './widget-config';
26
26
import { TemplateManager } from './template-manager' ;
27
27
import { ComponentProps } from './component' ;
28
28
import { ElementType , IOptionElement } from './configuration/react/element' ;
29
- import { IConfigNode } from './configuration/config-node' ;
30
29
31
30
import {
32
31
NestedOptionContext ,
@@ -96,8 +95,6 @@ const ComponentBase = forwardRef<ComponentBaseRef, any>(
96
95
97
96
const prevPropsRef = useRef < P & ComponentBaseProps > ( ) ;
98
97
99
- let widgetConfig : IConfigNode ;
100
-
101
98
const templateContainer = useMemo ( ( ) => document . createElement ( 'div' ) , [ ] ) ;
102
99
103
100
const elementDescriptor : IOptionElement = {
@@ -113,16 +110,13 @@ const ComponentBase = forwardRef<ComponentBaseRef, any>(
113
110
props,
114
111
} ;
115
112
116
- const options = useOptionScanning (
113
+ const [ widgetConfig , context ] = useOptionScanning (
117
114
elementDescriptor ,
118
115
props . children ,
119
116
templateContainer ,
120
117
Symbol ( 'initial update token' ) ,
121
118
) ;
122
119
123
- [ widgetConfig ] = options ;
124
- const [ , context ] = options ;
125
-
126
120
const restoreTree = useCallback ( ( ) => {
127
121
if ( childElementsDetached . current && childNodes . current ?. length && element . current ) {
128
122
element . current . append ( ...childNodes . current ) ;
0 commit comments