Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

141
Vistas
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 Respuestas
Responde la pregunta

0

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

about 4 years ago · Aman Chauhan Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda