Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
I am using the Google Autocomplete component and when onPlaceSelected I am saving the place into a state array (input) of the parent component. However, whenever a place is selected the previous value is set to an empty array and then adds the newly selected place, instead of adding it to the existing array. I am thinking it has something to do with refs (since I think the component uses these), but I'm not sure how to start fixing it, since I am not very experienced in using refs. Any help or advice would be appreciated.
Related posts
- Google Autocomplete + Record Filtering + React, How can I accomplish this?
- react-google-autocomplete freezing
- Python, if else, if, and wait second
- React/Firebase Question: How to avoid rendering HTML aimed for logged-out users when you are already logged-in and hit refresh on the browser?
- How to Setup and Add Google Analytics to your React App