react-leaflet icon indicating copy to clipboard operation
react-leaflet copied to clipboard

Fixing useRef() usage in createElementHook to prevent unnecessary Leaflet object creation

Open abac opened this issue 1 year ago • 0 comments

  • WAS: createElement() factory called at every render, therefore nullifying any benefits of using MutableRefObject
  • NOW: createElement() factory called only if useRef() does not hold an already cached element object

abac avatar Aug 04 '22 15:08 abac