export function buildChildElement()

in packages/codegen-ui-react/lib/react-component-render-helper.ts [370:397]


export function buildChildElement(prop?: ComponentPropertyValueTypes): JsxChild | undefined {
  if (!prop) {
    return undefined;
  }
  let expression: Expression | undefined;
  if (isFixedPropertyWithValue(prop)) {
    expression = buildFixedJsxExpression(prop);
  }
  if (isBoundProperty(prop)) {
    expression =
      prop.defaultValue === undefined
        ? buildBindingExpression(prop)
        : buildBindingWithDefaultExpression(prop, prop.defaultValue);
  }
  if (isCollectionItemBoundProperty(prop)) {
    expression =
      prop.defaultValue === undefined
        ? buildCollectionBindingExpression(prop)
        : buildCollectionBindingWithDefaultExpression(prop, prop.defaultValue);
  }
  if (isConcatenatedProperty(prop)) {
    expression = buildConcatExpression(prop);
  }
  if (isConditionalProperty(prop)) {
    expression = buildConditionalExpression(prop);
  }
  return expression && factory.createJsxExpression(undefined, expression);
}