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

Function wrapReactClass

packages/utils/src/is-react.ts:63–73  ·  view source on GitHub ↗
(view: FunctionComponent)

Source from the content-addressed store, hash-verified

61}
62
63export function wrapReactClass(view: FunctionComponent) {
64 let ViewComponentClass = class extends Component {
65 render() {
66 const { children, ...other } = this.props;
67 return createElement(view, other, children);
68 }
69 } as any;
70 ViewComponentClass = cloneEnumerableProperty(ViewComponentClass, view);
71 ViewComponentClass.displayName = view.displayName;
72 return ViewComponentClass;
73}

Callers 2

is-react.test.tsxFile · 0.90
buildComponentsFunction · 0.90

Calls 1

cloneEnumerablePropertyFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…