What is the proper way to utilize multiple useJsApiLoader
hooks in different components?
#2094
Unanswered
thepuzzlemaster
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Does the warning comes from this lib, or sub dependency? If it is this lib, One could make some flag to silence warnings. PR is welcome. If warning originated in sub dependency, you can raise an issue there. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Let's say I've got 2 components which both make api calls to the googleMaps api.
When this happens I get a console.warn about "Aborted attempt to load Google Maps JS with..."
I recognize that this is just a warning, and nothing bad has actually happened, but this warning logs every time I navigate to a page which utilizes one of the hooks after the first successful script load.
So I could move the hook up to a root level, and then perhaps set the
isLoaded
state in a React Context, so that it is accessible from nested components.Or I could just ignore the warnings, since they're not really doing anything too bad.
Is there a proper thing to do here? I don't imagine I'm the only person who has encountered this issue.
Thanks for any insight.
Beta Was this translation helpful? Give feedback.
All reactions