ErrorPro / react-google-autocomplete

React components for google places API.
MIT License
473 stars 114 forks source link

fix: TypeError: Cannot set properties of null (setting 'autocomplete') #139

Closed adriandmitroca closed 2 years ago

adriandmitroca commented 2 years ago

Currently, when registering MutationObserver there's no explicit check if ref still exists. This can be problematic when you work for example with conditional fields, and field is no longer rendered or haven't fully rendered yet.

This should fix this.

ErrorPro commented 2 years ago

@adriandmitroca Thanks for the PR, merged and released in 2.6.1