Skip to content

Using with Material UI's Autocomplete? #847

Discussion options

You must be logged in to vote

Posting my fix here in case anyone else comes across this!

import {
  ClickAwayListener,
  Grid,
  TextField,
  Typography,
} from '@material-ui/core';
import LocationOnIcon from '@material-ui/icons/LocationOn';
import parse from 'autosuggest-highlight/parse';
import Autocomplete from '@material-ui/lab/Autocomplete';
import usePlacesAutocomplete, {
  getGeocode,
  getLatLng,
} from 'use-places-autocomplete';
import { Coordinates } from './types';

interface Props {
  onSelect: (coordinates: Coordinates) => void;
}

const EditLocation: React.FC<Props> = ({ onSelect }) => {
  const {
    value,
    suggestions: { data },
    setValue,
    clearSuggestions,
  } = usePlacesAutocomplete({
    d…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jimmiejackson414-zz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant