react-google-maps-api: InfoBox error on language change

InfoBox causes error InvalidValueError: setMap: not an instance of Map; and not an instance of StreetViewPanorama on language change and does not render

https://codesandbox.io/s/gifted-violet-gp1cm?from-embed

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (4 by maintainers)

Most upvoted comments

@Diaver @MyriamMansouri i use ‘useLoadScript’ as a workaround

https://codesandbox.io/s/priceless-snyder-v1zij?file=/src/Map.js

Thank you! Solved it for me!

@Diaver @MyriamMansouri i use ‘useLoadScript’ as a workaround

https://codesandbox.io/s/priceless-snyder-v1zij?file=/src/Map.js

This saved my life 😃.

This problem only really started happening when I used the InfoBox, I also have a lot of Marker instances but they do not cause the issue even when I navigate back and forth.

Trying debug GoogleApi to understand what exactly wrong with it, but it is really hard to understand how it is working with obfuscated code: image Interesting moment here: we are trying set Map, and checking instance of Map which is looks good for me and for debugger initially, but throws exception: image Have no idea what is going on.

@samuelpucat please debug and provide a PR if you can.