Browse Source

Additional fixes to getComponentsFromDefs (#6342)

pull/6344/head
Artur Arseniev 1 year ago
committed by GitHub
parent
commit
07438bafb1
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 11
      packages/core/src/dom_components/model/Components.ts

11
packages/core/src/dom_components/model/Components.ts

@ -63,15 +63,20 @@ const getComponentsFromDefs = (
} }
} }
// Here `result` might be a Component
const cmp = isFunction(result.components) ? (result as unknown as Component) : null;
if (components) { if (components) {
const newComponents = getComponentsFromDefs(components, all, opts); const newComponents = getComponentsFromDefs(components, all, opts);
if (isFunction(result.components)) { if (cmp) {
const cmps = result.components(); cmp.components().reset(newComponents, opts);
cmps.length > 0 && cmps.reset(newComponents, opts);
} else { } else {
result.components = newComponents; result.components = newComponents;
} }
} else if (cmp) {
// The component already exists but the parsed one is without components
cmp.components().reset([], opts);
} }
return result; return result;

Loading…
Cancel
Save