ErrorPro / react-google-autocomplete

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

Reassign event listener when onPlaceSelected changes #234

Open AleksandrZhukov opened 3 months ago

AleksandrZhukov commented 3 months ago

I found that when onPlaceSelected handler has some dependencies, which can be change through the time - usePlacesWidget still calls the old version of onPlaceSelected.

Reassigning the event listener helps resolve this issue.