File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
packages/core/src/dom_components/model Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -63,15 +63,20 @@ const getComponentsFromDefs = (
6363 }
6464 }
6565
66+ // Here `result` might be a Component
67+ const cmp = isFunction ( result . components ) ? ( result as unknown as Component ) : null ;
68+
6669 if ( components ) {
6770 const newComponents = getComponentsFromDefs ( components , all , opts ) ;
6871
69- if ( isFunction ( result . components ) ) {
70- const cmps = result . components ( ) ;
71- cmps . length > 0 && cmps . reset ( newComponents , opts ) ;
72+ if ( cmp ) {
73+ cmp . components ( ) . reset ( newComponents , opts ) ;
7274 } else {
7375 result . components = newComponents ;
7476 }
77+ } else if ( cmp ) {
78+ // The component already exists but the parsed one is without components
79+ cmp . components ( ) . reset ( [ ] , opts ) ;
7580 }
7681
7782 return result ;
You can’t perform that action at this time.
0 commit comments