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

113
Vistas
“Objects are not valid as a React child”
    import React,{useEffect,useState} from "react"
    import axios from "axios"
    import './App.css';
    import Move from "./Move";
    
    
    function App() {
      const [data,setData] = useState([]);
      useEffect(()=> {
       axios.get("https://api.themoviedb.org/3/movie/popular?api_key={apikey}&language=en-US&page=1").then((res)=> {
        setData(res.data.results)
       
       
       })
      },[])
    
      return (
       <div>
        
        <div className="App">
    <input placeholder="enter something" />
    <label></label>
        </div>
        {
        data.map(function(movie){
          console.log(movie)
        const title = movie.title
        const id = movie.id
         
        return <Move key={id} title={title}  />
    })}
        </div>
      );
    
    
    
    
      }
    
    
    
    
    
    export default App;
Component Im Trying To Render
import React from 'react'

const Move = (title) => {
  return (
      <div>
    <div>Move</div>
    <h1>{title}</h1>

</div>
  )
}

export default Move

im trying get access properties of the object for example title but im getting the error “Objects are not valid as a React child”

the object is :

{
    "adult": false,
    "backdrop_path": "/iQFcwSGbZXMkeyKrxbPnwnRo5fl.jpg",
    "genre_ids": [
        28,
        12,
        878
    ],
    "id": 634649,
    "original_language": "en",
    "original_title": "Spider-Man: No Way Home",
    "overview": "Peter Parker is unmasked and no longer able to separate his normal life from the high-stakes of being a super-hero. When he asks for help from Doctor Strange the stakes become even more dangerous, forcing him to discover what it truly means to be Spider-Man.",
    "popularity": 8450.164,
    "poster_path": "/1g0dhYtq4irTY1GPXvft6k4YLjm.jpg",
    "release_date": "2021-12-15",
    "title": "Spider-Man: No Way Home",
    "video": false,
    "vote_average": 8.4,
    "vote_count": 8021
}

not sure what the problem is

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

const Move = (title) => {
  return (
    <div>
      <div>Move</div>
      <h1>{title}</h1>
    </div>
  );
};

In this code, title is the entire props object. You need to access just the title property on that object:

const Move = (props) => {
  return (
    <div>
      <div>Move</div>
      <h1>{props.title}</h1>
    </div>
  );
};

Or with destructuring:

const Move = ({ title }) => {
  return (
    <div>
      <div>Move</div>
      <h1>{title}</h1>
    </div>
  );
};

about 4 years ago · Juan Pablo Isaza Denunciar

0

import React from 'react'

const Move = (prop) => {
  return (
      <div>
    <div>Move</div>
    <h1>{prop.title}</h1>

</div>
  )
}
about 4 years ago · Juan Pablo Isaza 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