ReactDependentScript icon indicating copy to clipboard operation
ReactDependentScript copied to clipboard

Load google map script multiple times

Open JSEvgeny opened this issue 6 years ago • 1 comments

Having two component instances on one page makes it load dependant scripts multiple time and causes "error" in browser console: You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors.

JSEvgeny avatar Dec 16 '19 07:12 JSEvgeny

It would be good if there is some predicate prop, that can be passed a function, to check whether to do the actual load. In case of google maps, predicate can be:

() => 'google' in window

Dragomir-Ivanov avatar Jul 01 '20 11:07 Dragomir-Ivanov