MCPcopy
hub / github.com/mjmlio/mjml / initComponent

Function initComponent

packages/mjml-core/src/createComponent.js:20–37  ·  view source on GitHub ↗
({ initialDatas, name })

Source from the content-addressed store, hash-verified

18import jsonToXML from './helpers/jsonToXML'
19
20export function initComponent({ initialDatas, name }) {
21 const Component = initialDatas.context.components[name]
22
23 if (Component) {
24 const component = new Component(initialDatas)
25
26 if (component.headStyle) {
27 component.context.addHeadStyle(name, component.headStyle)
28 }
29 if (component.componentHeadStyle) {
30 component.context.addComponentHeadSyle(component.componentHeadStyle)
31 }
32
33 return component
34 }
35
36 return null
37}
38
39class Component {
40 static getTagName() {

Callers 3

processingFunction · 0.90
renderChildrenMethod · 0.85
handlerChildrenMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…