( useElement: ElementHook<E, PropsWithoutRef<P>>, )
| 21 | }> |
| 22 | |
| 23 | export function createContainerComponent<E, P extends PropsWithChildren>( |
| 24 | useElement: ElementHook<E, PropsWithoutRef<P>>, |
| 25 | ) { |
| 26 | function ContainerComponent(props: PropsWithoutRef<P>, forwardedRef: Ref<E>) { |
| 27 | const { instance, context } = useElement(props).current |
| 28 | useImperativeHandle(forwardedRef, () => instance) |
| 29 | |
| 30 | const { children } = props as PropsWithChildren |
| 31 | return children == null ? null : ( |
| 32 | <LeafletContext value={context}>{children}</LeafletContext> |
| 33 | ) |
| 34 | } |
| 35 | |
| 36 | return forwardRef(ContainerComponent) |
| 37 | } |
| 38 | |
| 39 | export function createDivOverlayComponent< |
| 40 | E extends DivOverlay, |
no outgoing calls
no test coverage detected
searching dependent graphs…