MCPcopy
hub / github.com/mantinedev/mantine / factory

Function factory

packages/@mantine/core/src/core/factory/factory.tsx:84–97  ·  view source on GitHub ↗
(
  ui: (props: Payload['props'] & { ref?: React.Ref<Payload['ref']> }) => React.ReactNode
)

Source from the content-addressed store, hash-verified

82}
83
84export function factory<Payload extends FactoryPayload>(
85 ui: (props: Payload['props'] & { ref?: React.Ref<Payload['ref']> }) => React.ReactNode
86) {
87 const Component = ui as any;
88 Component.extend = identity as any;
89 Component.withProps = (fixedProps: any) => {
90 const Extended = (props: any) => <Component {...fixedProps} {...props} />;
91 Extended.extend = Component.extend;
92 Extended.displayName = `WithProps(${Component.displayName})`;
93 return Extended;
94 };
95
96 return Component as MantineComponent<Payload>;
97}
98
99export function genericFactory<Payload extends FactoryPayload>(ui: Payload['signature']) {
100 return factory(ui as any) as Payload['signature'] &

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…