window.google is undefined in react?
问题 When I call window and console log it I get a google prop as you see here: Yet when I try to call window.google I get undefined. Am I missing something here? 回答1: Hey I came across a similar issue trying to instantiate a new window.google.maps.Map and found this solution helped me. When declaring your <script> tag, give it an identifier so that you can grab it later in your component. On the mounting of your component, set up a load event listener on the Google script and wait until it's