MCPcopy
hub / github.com/PaulLeCam/react-leaflet / createLeafComponent

Function createLeafComponent

packages/core/src/component.tsx:66–77  ·  view source on GitHub ↗
(
  useElement: ElementHook<E, PropsWithoutRef<P>>,
)

Source from the content-addressed store, hash-verified

64}
65
66export function createLeafComponent<E, P>(
67 useElement: ElementHook<E, PropsWithoutRef<P>>,
68) {
69 function LeafComponent(props: PropsWithoutRef<P>, forwardedRef: Ref<E>) {
70 const { instance } = useElement(props).current
71 useImperativeHandle(forwardedRef, () => instance)
72
73 return null
74 }
75
76 return forwardRef(LeafComponent)
77}

Callers 3

components.tsxFile · 0.90
createControlComponentFunction · 0.85
createTileLayerComponentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…