(
ui: (props: Payload['props'] & { ref?: React.Ref<Payload['ref']> }) => React.ReactNode
)
| 82 | } |
| 83 | |
| 84 | export 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 | |
| 99 | export function genericFactory<Payload extends FactoryPayload>(ui: Payload['signature']) { |
| 100 | return factory(ui as any) as Payload['signature'] & |
no outgoing calls
no test coverage detected
searching dependent graphs…