Currently I have a component: QuickAdd that needs the google autocomplete api to run
However, while the component renders, it doesn't seem like the autocomplete has finished loading. If i go to another component and then return to the QuickAdd component then it works, which makes me think it needs to rerender after the script is loaded.
The globalName is always passed as a prop and but is always undefined. What other listener can i use for this?
const callbackName = "onloadcallback"; const globalName = "quickAddLoader"; const url = https://maps.googleapis.com/maps/api/js?key=API_KEY&libraries=places`;
const AsyncHoc = makeAsyncScriptLoader(url, {globalName: globalName})(QuickAdd);
export default AsyncHoc; `
Currently I have a component: QuickAdd that needs the google autocomplete api to run
However, while the component renders, it doesn't seem like the autocomplete has finished loading. If i go to another component and then return to the QuickAdd component then it works, which makes me think it needs to rerender after the script is loaded.
The globalName is always passed as a prop and but is always undefined. What other listener can i use for this?
const callbackName = "onloadcallback"; const globalName = "quickAddLoader"; const url =https://maps.googleapis.com/maps/api/js?key=API_KEY&libraries=places`;const AsyncHoc = makeAsyncScriptLoader(url, {globalName: globalName})(QuickAdd);
export default AsyncHoc; `