react-native-google-places-autocomplete
react-native-google-places-autocomplete copied to clipboard
feat add `loadOnMount` prop
What's in this PR?
This PR adds the loadOnMount prop to enable or disable loading the default value's search results after the view has been rendered, which is true by default.
I'm not grasping the problem you are trying to solve here. Would you mind giving me a little more context here?
Here's an example:
- The customer has an address saved in the DB
- The page loads, the
props.valueis set to1 Montgomery streetfor example (address line 1) - The customer doesn't necessarily want to change it. Therefore, you don't need to load the default search results.
- In addition, this also triggers
props.onChangeTexton mount, which is not the desired behavior in my case:- https://github.com/FaridSafi/react-native-google-places-autocomplete/blob/531261700e30e494d70db1dcf0b197a212eede04/GooglePlacesAutocomplete.js#L557-L565 - https://github.com/FaridSafi/react-native-google-places-autocomplete/blob/531261700e30e494d70db1dcf0b197a212eede04/GooglePlacesAutocomplete.js#L148-L150
Please let me know if you need more information.
@bell-steven any updates on that?
I don't have the time to test this thoroughly atm. I would recommend using patch-package in the interim.