@yumakaev

Как проверить поменялся ли id?

Здравствуйте!
Выгружаю данные через редакс, используя useEffect, но в консоль получаю следующее:

./src/components/app-promo/app-promo.js
  Line 22:5:  React Hook useEffect has missing dependencies: 'heroesPromoLoaded' and 'promoService'. Either include them or remove the dependency array. If 'heroesPromoLoaded' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps


useEffect:
useEffect(() => {
		const data = promoService.getHeroes();
		heroesPromoLoaded(data);
	}, [promoHeroes.id]);
  • Вопрос задан
  • 56 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы