diff --git a/web-ui/src/components/ufe-context/ufe-context.tsx b/web-ui/src/components/ufe-context/ufe-context.tsx index f1d7d97..e324ee8 100644 --- a/web-ui/src/components/ufe-context/ufe-context.tsx +++ b/web-ui/src/components/ufe-context/ufe-context.tsx @@ -33,16 +33,34 @@ export class UfeContext { const contextElements = this.ufeRegistry.contextElements( this.context, this.selector ); this.ufeRegistry.preloadDependenciesAsync(contextElements); + return ( - {contextElements.map( el => { - const element = this.ufeRegistry.loadAndRenderElement(el, Object.assign({}, this.extraAttributes, this.data)); + {contextElements.map( el => { + const attr = Object.assign( + {}, + this.extraAttributes, + el.attributes.reduce( + (acc, a) => { + acc[a.name] = a.value; + return acc + }, {} as { + [name: string]: any + }) + ); + return ( - { element } + { + if (_) { + for (let key in this.data) { + _[key] = this.data[key]; + } + } + })}> )