Skip to content

window.google object is gone after unmount and mount the Lazy-loading Wrapper Component. #10

@jetstreamc

Description

@jetstreamc

I don't really sure why.
When 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.
I 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.
The solution I've temporally did is to recreate my own wrapper with this add-on function.

componentWillUnmount() {
  window._scriptMap.delete("google");
}

However, I don't think it is a good idea to do so.
Could you figure out why the window.google object is gone when remounting and fix it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions