Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

133
Visualizações
I'm building netflix clone using reactjs.It is shownig the page for 1 sec and it turns blank again
 [import React, { useEffect, useState } from 'react';
 import './Row.css';
 import axios from './axios'

 function Row({ title,fetchUrl, isLargeRow = false}) {
    const [movies, setMovies] = useState([]);

    const base_url = "https://image.tmdb.org/t/p/original/"

    useEffect(() => {
        async function fetchData() {
            const request = await axios.get(fetchUrl);
            setMovies(request.data.results);
            return request;
        }

        fetchData();
}, [fetchUrl[]][1]);

// console.log(movies);

  return (
    <div className='row'>
        <h2>{title}</h2>

        {movies.map((movie) => (
             <img src={`${base_url}${
                isLargeRow ? movie.poster_path : movie.backdrop_path
            }`} alt={movie.name}
            />
            ))}
     </div>
  );
}

export default Row

I am getting an error

Warning: Each child in a list should have a unique "key" prop.

Check the render method of Row. See https://reactjs.org/link/warning-keys for more information. at img at Row (http://localhost:3000/static/js/bundle.js:596:5) at div at HomeScreen at div at App at Provider (http://localhost:3000/static/js/bundle.js:43095:5)

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

In dependency of useEffect just give fetchUrl like
like this
}, [fetchUrl]);

about 4 years ago · Aman Chauhan Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda