I am using a ready made component from https://www.npmjs.com/package/react-google-places-autocomplete for google autocomplete places
But I want to initialize it with place. (because when i edit a form, i have to show the place there)
import React from "react";
import GooglePlacesAutocomplete from "react-google-places-autocomplete";
const GooglePlacesAutocompleteComponent = () => (
<div>
<GooglePlacesAutocomplete
apiKey="xxxxxxxxxxxxxxx"
/>
</div>
);
export default Component;
The above is the component
and use is as
<GooglePlacesAutocompleteComponent />}
I know react-google-places-autocomplete
uses react-select
AsyncSelect
<AsyncSelect
{...selectProps}
loadOptions={fetchSuggestions}
getOptionValue={({ value }) => value.place_id}
/>
the fetchsugestions is list of {label and value}
HOw to pass the intial value