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

Function createPathHook

packages/core/src/path.ts:32–46  ·  view source on GitHub ↗
(useElement: ElementHook<E, P>)

Source from the content-addressed store, hash-verified

30}
31
32export function createPathHook<
33 E extends FeatureGroup | Path,
34 P extends PathProps,
35>(useElement: ElementHook<E, P>) {
36 return function usePath(props: P): ReturnType<ElementHook<E, P>> {
37 const context = useLeafletContext()
38 const elementRef = useElement(withPane(props, context), context)
39
40 useEventHandlers(elementRef.current, props.eventHandlers)
41 useLayerLifecycle(elementRef.current, context)
42 usePathOptions(elementRef.current, props)
43
44 return elementRef
45 }
46}

Callers 1

createPathComponentFunction · 0.85

Calls 5

useLeafletContextFunction · 0.85
withPaneFunction · 0.85
useEventHandlersFunction · 0.85
useLayerLifecycleFunction · 0.85
usePathOptionsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…