MCPcopy Create free account
hub / github.com/alibaba/lowcode-engine / createContent

Function createContent

packages/utils/src/create-content.ts:4–16  ·  view source on GitHub ↗
(
    content: ReactNode | ComponentType<any>,
    props?: Record<string, unknown>,
  )

Source from the content-addressed store, hash-verified

2import { isReactComponent } from './is-react';
3
4export function createContent(
5 content: ReactNode | ComponentType<any>,
6 props?: Record<string, unknown>,
7 ): ReactNode {
8 if (isValidElement(content)) {
9 return props ? cloneElement(content, props) : content;
10 }
11 if (isReactComponent(content)) {
12 return createElement(content, props);
13 }
14
15 return content;
16}

Callers 6

SettersClass · 0.85
createSettingFieldViewFunction · 0.85
bodyMethod · 0.85
bodyMethod · 0.85
bodyMethod · 0.85

Calls 1

isReactComponentFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…