ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Fetch Data from API with useEffect in React JS | React JS | EP - 8

JASACADAMY

Technical

Coding

React native

nodejs

Devops

News

interview tips

resume format

resume writing

career

communication

social meda

time management

polytechnic

diploma

Perfomance

development

udemy

google

covid

jasacadamy

Автор: JAS ACADAMY

Загружено: 2022-02-01

Просмотров: 616

Описание: This video will quickly go over how to make use of the useEffect hook in React to retrieve data from an API.

This video assumes that you have a general understanding of how to fetch/retrieve data from an API as well as the fundamentals of React and React Hooks.

The component will be responsible for displaying an image of a random dog that is received from the API that we are fetching from. To do this, we'll need to:

Import useState and useEffect
Create our dogImage variable as well as the setDogImage function via useState
Create out useEffect function — this is where we'll perform our fetch
Within our useEffect function we'll use setDogImage to.. well... set dogImage to the image url that we received
Use dogImage as the src for our image so that we can display the random dog

The API that we're using has a few different endpoints that we can use, but for this simple example we'll just use the random image endpoint. This endpoint will simply return an object containing a message key and status key, we're only concerned about the message key in this simple example. The message key will contain the url that we'll use as the source for our image.




#reactjs #reactutorial #fetch #reactjstraining
#jasacadamy

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Fetch Data from API with useEffect in React JS | React JS | EP - 8

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]