( element: LeafletElement<FeatureGroup | Path>, props: PathProps, )
| 12 | } |
| 13 | |
| 14 | export function usePathOptions( |
| 15 | element: LeafletElement<FeatureGroup | Path>, |
| 16 | props: PathProps, |
| 17 | ) { |
| 18 | const optionsRef = useRef<PathOptions | undefined>(undefined) |
| 19 | |
| 20 | useEffect( |
| 21 | function updatePathOptions() { |
| 22 | if (props.pathOptions !== optionsRef.current) { |
| 23 | const options = props.pathOptions ?? {} |
| 24 | element.instance.setStyle(options) |
| 25 | optionsRef.current = options |
| 26 | } |
| 27 | }, |
| 28 | [element, props], |
| 29 | ) |
| 30 | } |
| 31 | |
| 32 | export function createPathHook< |
| 33 | E extends FeatureGroup | Path, |
no outgoing calls
no test coverage detected
searching dependent graphs…