MCPcopy Create free account
hub / github.com/BuilderIO/mitosis / processDynamicComponents

Function processDynamicComponents

packages/core/src/generators/solid/index.ts:39–51  ·  view source on GitHub ↗
(json: MitosisComponent, options: ToSolidOptions)

Source from the content-addressed store, hash-verified

37
38// Transform <foo.bar key={value} /> to <Dynamic compnent={foo.bar} key={value} />
39function processDynamicComponents(json: MitosisComponent, options: ToSolidOptions) {
40 let found = false;
41 traverse(json).forEach((node) => {
42 if (isMitosisNode(node)) {
43 if (node.name.includes('.') && !node.name.endsWith('.Provider')) {
44 node.bindings.component = createSingleBinding({ code: node.name });
45 node.name = 'Dynamic';
46 found = true;
47 }
48 }
49 });
50 return found;
51}
52
53function getContextString(component: MitosisComponent, options: ToSolidOptions) {
54 let str = '';

Callers 1

componentToSolidFunction · 0.70

Calls 3

isMitosisNodeFunction · 0.90
createSingleBindingFunction · 0.90
traverseFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…