Тёмный

Google Autoplaces Material UI 

sonam serchan
Подписаться 107
Просмотров 1,2 тыс.
50% 1

#google #placesapi #autocompletesuggestions #materialui #reactjs #typescript
Hey guys, just a small video on how to use use-places-autocomplete (github.com/wel...) library to fetch places on user input in Autocomplete component from Material UI. The library does all the heavy lifting for you handling the place predictions of Google Places API.
Make sure to generate an API key first: developers.goo...
If you don't have google could project, then you can follow the steps here.
developers.goo...
I also forgot to mention that you can pas freeSolo prop to Autocomplete to remove the default No Options dropdown when there's no input given.
Happy Coding!

Опубликовано:

 

16 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 7   
@chineduugbo310
@chineduugbo310 7 месяцев назад
Nice video. How can one hide the API key in .env then use it on index.html file.
@Martin-rq5tp
@Martin-rq5tp 9 месяцев назад
Great video! How do you restrict the suggestions within a specific country?
@brandon400
@brandon400 9 месяцев назад
could you do it bro?
@Martin-rq5tp
@Martin-rq5tp 9 месяцев назад
@@brandon400 Yes! you can add extra params in usePlacesAutocomplete like this: const {suggestions: { data } } = usePlacesAutocomplete({ types: ['geocode'], requestOptions: { componentRestrictions: { country: 'US' }, }, }); you can check the country codes on their documentation and make sure to clear cache as there was an issue raised, which I experience as well, where this won't reflect without clearing cache.
@brandon400
@brandon400 9 месяцев назад
Thank you very much martin
@TP29
@TP29 6 месяцев назад
hi, How do I get the address for Italy?
@sonam-serchan
@sonam-serchan 3 месяца назад
Hey, sorry for late reply! Did you get your answer? If not, you can restrict the country following way: const {suggestions: { data } } = usePlacesAutocomplete({ types: ['geocode'], requestOptions: { componentRestrictions: { country: 'US' }, }, });
Далее
Google Places - Autocomplete in React
16:05
Просмотров 55 тыс.
I Left Google - Here's Why
13:22
Просмотров 10 тыс.
Сколько стоят роды мечты?
00:59
Просмотров 902 тыс.
Autocomplete - Learn Material UI Components in React
12:37
Turns out REST APIs weren't the answer (and that's OK!)
10:38
THIS REACT UI LIBRARY CHANGES EVERYTHING 🤯
8:03
Просмотров 102 тыс.
React Custom Hooks: useDebounce - Simply Explained!
10:38
React Material-UI table Tutorial
14:07
Просмотров 52 тыс.