ReactDependentScript
ReactDependentScript copied to clipboard
Load google map script multiple times
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.
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