MCPcopy Index your code
hub / github.com/PaulLeCam/react-leaflet / createControlComponent

Function createControlComponent

packages/core/src/generic.ts:34–47  ·  view source on GitHub ↗
(createInstance: (props: PropsWithoutRef<P>) => E)

Source from the content-addressed store, hash-verified

32interface PathWithChildrenProps extends PathProps, PropsWithChildren {}
33
34export function createControlComponent<
35 E extends Control,
36 P extends ControlOptions,
37>(createInstance: (props: PropsWithoutRef<P>) => E) {
38 function createElement(
39 props: PropsWithoutRef<P>,
40 context: LeafletContextInterface,
41 ): LeafletElement<E> {
42 return createElementObject(createInstance(props), context)
43 }
44 const useElement = createElementHook(createElement)
45 const useControl = createControlHook(useElement)
46 return createLeafComponent(useControl)
47}
48
49export function createLayerComponent<
50 E extends Layer,

Callers 4

generic.tsxFile · 0.90
ScaleControl.tsxFile · 0.90
ZoomControl.tsxFile · 0.90

Calls 3

createElementHookFunction · 0.85
createControlHookFunction · 0.85
createLeafComponentFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…