gribnoysup / react-yandex-maps

Yandex Maps API bindings for React
MIT License
329 stars 116 forks source link

Placemark, instanceRef called twice #230

Closed Art-Mas closed 4 years ago

Art-Mas commented 4 years ago

Hello. Actually, the title speaks for itself-instanceRef called twice. Here is an example: https://codesandbox.io/s/billowing-resonance-nub41 Maybe I'm doing something wrong?

gribnoysup commented 4 years ago

Thanks for reporting this issue, your code is totally fine! There was a bug in the library that is fixed in v4.4.0

Keep in mind that in your particular example instanceRef can still be called twice as functions are created in the render method and thus they are not referentially equal. You can read more about how refs behave in React docs https://reactjs.org/docs/refs-and-the-dom.html#caveats-with-callback-refs