R1ZEN / react-yandex-maps

Yandex.Maps API bindings for React (fork https://github.com/gribnoysup/react-yandex-maps)
https://pbe-react-yandex-maps.vercel.app
MIT License
120 stars 20 forks source link

Access Map instance with `withYMaps` hook #30

Closed Semro closed 1 year ago

Semro commented 1 year ago

Hello! Is it possible to get map instance through withYMaps hook that was created in other component with useYMaps?

R1ZEN commented 1 year ago

@Semro Hello! No, you can't access to the instance of Map through hook useYMaps. To access a map instance use instanceRef prop on Map component.

Semro commented 1 year ago

I see. Thank you!