Closed cheymonty closed 2 years ago
You can try an alternative way of adding the google map script and see if it still breaks your website
I am also seeing this issue. It seems to be specific to React v18.
Here is an example:
https://codesandbox.io/s/snowy-tree-4v8pz8?file=/src/App.js
When you uncomment the <input>
, the page crashes. I suspect some sort of infinite loop, but I haven't had time to dig into the details.
@ErrorPro would you be okay re-opening this issue given the repro I provided above?
@pifantastic Of course, I'll check it asap and make sure its fixed
Found out the issue. I will try to fix it asap and ship a new version.
@ErrorPro, is there anything we can do to help? I'm facing the same issue.
@jmferreiratech Hey! I am terrible busy these days with the work related projects. If you can just check why the mutation observer hangs the render that would be helpful.
@pifantastic and @cheymonty, I've noted that the issue happens only on StrictMode. Could you please confirm that is the case for you too?
@jmferreiratech Yes the component works when not in StrictMode!
Has this been fixed?
@BrightonNgema @cheymonty @jmferreiratech Can you guys try out 2.7.0? I wrapped the problematic stuff into a condition to not work on react 18. It was a workaround right from the start, so no wonder it caused the issue. Meantime I'll take a deeper look into the original issue and try to come up with a more robust fix.
My places api key is correct and has billing enabled. I am importing like this
import Autocomplete from 'react-google-autocomplete';
When I put this in my code:<Autocomplete apiKey={API_KEY} onPlaceSelected={(place) => { console.log(place); }} />
the website freezes and gets stuck in a loop until the website crashes.