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

Function createLayerComponent

packages/core/src/generic.ts:49–66  ·  view source on GitHub ↗
(
  createElement: (
    props: PropsWithoutRef<P>,
    context: LeafletContextInterface,
  ) => LeafletElement<E>,
  updateElement?: (
    instance: E,
    props: PropsWithoutRef<P>,
    prevProps: PropsWithoutRef<P>,
  ) => void,
)

Source from the content-addressed store, hash-verified

47}
48
49export function createLayerComponent<
50 E extends Layer,
51 P extends LayerWithChildrenProps,
52>(
53 createElement: (
54 props: PropsWithoutRef<P>,
55 context: LeafletContextInterface,
56 ) => LeafletElement<E>,
57 updateElement?: (
58 instance: E,
59 props: PropsWithoutRef<P>,
60 prevProps: PropsWithoutRef<P>,
61 ) => void,
62) {
63 const useElement = createElementHook(createElement, updateElement)
64 const useLayer = createLayerHook(useElement)
65 return createContainerComponent(useLayer)
66}
67
68export function createOverlayComponent<
69 E extends DivOverlay,

Callers 5

generic.tsxFile · 0.90
LayerGroup.tsxFile · 0.90
ImageOverlay.tsxFile · 0.90
VideoOverlay.tsxFile · 0.90
Marker.tsxFile · 0.90

Calls 3

createElementHookFunction · 0.85
createLayerHookFunction · 0.85
createContainerComponentFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…