@@ -25,7 +25,7 @@ import { DXRemoveCustomArgs, DXTemplateCreator, InitArgument } from './types';
2525import { elementPropNames , getClassName } from './widget-config' ;
2626import { TemplateManager } from './template-manager' ;
2727import { ComponentProps } from './component' ;
28- import { ElementType } from './configuration/react/element' ;
28+ import { ElementType , IOptionElement } from './configuration/react/element' ;
2929import { IConfigNode } from './configuration/config-node' ;
3030
3131import {
@@ -341,19 +341,24 @@ const ComponentBase = forwardRef<ComponentBaseRef, any>(
341341
342342 const templateContainer = useMemo ( ( ) => document . createElement ( 'div' ) , [ ] ) ;
343343
344- const options = useOptionScanning (
345- {
346- type : ElementType . Option ,
347- descriptor : {
348- name : '' ,
349- isCollection : false ,
350- templates : templateProps ,
351- initialValuesProps : defaults ,
352- predefinedValuesProps : { } ,
353- expectedChildren,
354- } ,
355- props,
344+ const elementDescriptor : IOptionElement = useMemo ( ( ) => ( {
345+ type : ElementType . Option ,
346+ descriptor : {
347+ name : '' ,
348+ isCollection : false ,
349+ templates : templateProps ,
350+ initialValuesProps : defaults ,
351+ predefinedValuesProps : { } ,
352+ expectedChildren,
356353 } ,
354+ props,
355+ } ) , [
356+ templateProps ,
357+ defaults ,
358+ ] ) ;
359+
360+ const options = useOptionScanning (
361+ elementDescriptor ,
357362 props . children ,
358363 templateContainer ,
359364 Symbol ( 'initial update token' ) ,
0 commit comments