(useElement: ElementHook<E, P>)
| 30 | } |
| 31 | |
| 32 | export 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 | } |
no test coverage detected
searching dependent graphs…