{"action":"created","issue":{"url":"https://api.github.com/repos/fullstackreact/google-maps-react/issues/10","repository_url":"https://api.github.com/repos/fullstackreact/google-maps-react","labels_url":"https://api.github.com/repos/fullstackreact/google-maps-react/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/fullstackreact/google-maps-react/issues/10/comments","events_url":"https://api.github.com/repos/fullstackreact/google-maps-react/issues/10/events","html_url":"https://github.com/fullstackreact/google-maps-react/issues/10","id":167987906,"number":10,"title":"window.google object is gone after unmount and mount the Lazy-loading Wrapper Component.","user":{"login":"jetstreamc","id":9064341,"avatar_url":"https://avatars.githubusercontent.com/u/9064341?v=3","gravatar_id":"","url":"https://api.github.com/users/jetstreamc","html_url":"https://github.com/jetstreamc","followers_url":"https://api.github.com/users/jetstreamc/followers","following_url":"https://api.github.com/users/jetstreamc/following{/other_user}","gists_url":"https://api.github.com/users/jetstreamc/gists{/gist_id}","starred_url":"https://api.github.com/users/jetstreamc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jetstreamc/subscriptions","organizations_url":"https://api.github.com/users/jetstreamc/orgs","repos_url":"https://api.github.com/users/jetstreamc/repos","events_url":"https://api.github.com/users/jetstreamc/events{/privacy}","received_events_url":"https://api.github.com/users/jetstreamc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-07-28T00:33:25Z","updated_at":"2016-08-07T10:57:31Z","closed_at":null,"body":"I don't really sure why. \r\nWhen the component is unmounted, the window.google is still. But, when the wrapper component is mounted again, the window.google becomes null for unknown reason.\r\nI look through the implementation of wrapper and found that the **ScriptCache.js** loads the Google map script only once and no hope to reload it even if the window.google object is gone away from browser.\r\nThe solution I've temporally did is to recreate my own wrapper with this add-on function.\r\n```\r\ncomponentWillUnmount() {\r\n  window._scriptMap.delete(\"google\");\r\n}\r\n```\r\nHowever, I don't think it is a good idea to do so.\r\nCould you figure out why the window.google object is gone when remounting and fix it?"},"comment":{"url":"https://api.github.com/repos/fullstackreact/google-maps-react/issues/comments/238076010","html_url":"https://github.com/fullstackreact/google-maps-react/issues/10#issuecomment-238076010","issue_url":"https://api.github.com/repos/fullstackreact/google-maps-react/issues/10","id":238076010,"user":{"login":"tnwt7","id":811559,"avatar_url":"https://avatars.githubusercontent.com/u/811559?v=3","gravatar_id":"","url":"https://api.github.com/users/tnwt7","html_url":"https://github.com/tnwt7","followers_url":"https://api.github.com/users/tnwt7/followers","following_url":"https://api.github.com/users/tnwt7/following{/other_user}","gists_url":"https://api.github.com/users/tnwt7/gists{/gist_id}","starred_url":"https://api.github.com/users/tnwt7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tnwt7/subscriptions","organizations_url":"https://api.github.com/users/tnwt7/orgs","repos_url":"https://api.github.com/users/tnwt7/repos","events_url":"https://api.github.com/users/tnwt7/events{/privacy}","received_events_url":"https://api.github.com/users/tnwt7/received_events","type":"User","site_admin":false},"created_at":"2016-08-07T10:57:31Z","updated_at":"2016-08-07T10:57:31Z","body":"It seems like `window.google` is reset every time. My current workaround is make a change in `GoogleApi`:\r\nfrom\r\n```js\r\nlet google = window.google == null;\r\n```\r\nto\r\n```js\r\nlet google = window.google || null;\r\n```"}}
{"actor":{"display_login":"tnwt7"}}